diff --git a/src/cli/command_parser.rb b/src/cli/command_parser.rb index dff2e46b22..6bd89019a3 100755 --- a/src/cli/command_parser.rb +++ b/src/cli/command_parser.rb @@ -293,6 +293,20 @@ module CommandParser else id=0 @args.collect!{|arg| + unless format=args_format[id] + args_str=args_format.collect{ |a| + if a.include?(nil) + "[#{a.compact.join("|")}]" + else + "<#{a.join("|")}>" + end + }.join(' ') + + puts "Wrong number of arguments" + puts "The arguments should be: #{args_str}" + exit -1 + end + format = args_format[id] argument = nil error_msg = nil