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