forked from ManageIQ/optimist
-
Notifications
You must be signed in to change notification settings - Fork 0
When options are not found
nanobowers edited this page Oct 15, 2017
·
2 revisions
When an unknown option is given, Trollop will return an unknown argument message by default.
$ ./lesshelp.rb -x
Error: unknown argument '-x'.
Try --help for help.
Adding educate_on_error
will display the help message instead (via educate
).
require 'trollop'
opts = Trollop::options do
opt :cat, "A cat option"
educate_on_error
end
$ ./morehelp.rb -x
Error: unknown argument '-x'.
Options:
-c, --cat A cat option
-h, --help Show this message