This lets Cri handle options before validating arguments, so that a command that has multiple parameters can still take a -h option with zero arguments, provided that the -h option handler exits. For example:
param :foo
option :h, :help, 'show help' do
puts 'I am helping I swear'
exit 0
end
… when given -h, will print I am helping I swear, without raising an exception.
This also changes parser.arguments to parser.gen_argument_list, which I believe makes it more clear that it is not a mere accessor.
This lets Cri handle options before validating arguments, so that a command that has multiple parameters can still take a
-h
option with zero arguments, provided that the-h
option handler exits. For example:… when given
-h
, will printI am helping I swear
, without raising an exception.This also changes
parser.arguments
toparser.gen_argument_list
, which I believe makes it more clear that it is not a mere accessor.