Parser: now gives a better understanding of the error.

rewrite
Karchnu 2020-10-26 19:24:57 +01:00
parent df22fe8a9b
commit f335be76de
1 changed files with 2 additions and 0 deletions

View File

@ -56,6 +56,8 @@ unrecognized_args_to_context_args = -> (parser : OptionParser, n_expected_args :
# With the right args, these will be interpreted as serialized data. # With the right args, these will be interpreted as serialized data.
parser.unknown_args do |args| parser.unknown_args do |args|
if args.size != n_expected_args if args.size != n_expected_args
Baguette::Log.error "expected number of arguments: #{n_expected_args}, received: #{args.size}"
Baguette::Log.error "args: #{args}"
Baguette::Log.error "#{parser}" Baguette::Log.error "#{parser}"
exit 1 exit 1
end end