1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

feature #661: Check number of arguments

This commit is contained in:
Daniel Molina 2011-06-10 12:25:08 +02:00
parent 5a958f7032
commit aca8140a5d

View File

@ -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