View on GitHub
Stop parsing of options as soon as an unknown option or a regular
argument is encountered. All remaining arguments are passed to the command.
This is useful if you have a command that can receive arbitrary additional
options, and where those additional options should not be handled by
To better understand how this is useful, let's consider a command that calls
an external command. A user may want to pass arbitrary options and
arguments to that command. The command itself also accepts some options,
which should be handled by Bundler::Thor.
class_option "verbose", :type => :boolean
check_unknown_options! :except => :exec
desc "exec", "Run a shell command"
puts "diagnostic output" if options[:verbose]
Here +exec+ can be called with +--verbose+ to get diagnostic output,
$ thor exec --verbose echo foo
But if +--verbose+ is given after +echo+, it is passed to +echo+ instead:
$ thor exec echo --verbose foo
Symbol ...:: A list of commands that should be affected.
- Describe what "Thor.stop_on_unknown_option!" returns.
- Describe the parameter "command_names".