Method: Bundler::Thor.method_exclusive
- Defined in:
- lib/bundler/vendor/thor/lib/thor.rb
permalink .method_exclusive(*args, &block) ⇒ Object Also known as: exclusive
Adds and declares option group for exclusive options in the block and arguments. You can declare options as the outside of the block.
If :for is given as option, it allows you to change the options from a previous defined command.
Parameters
- options<Hash>
-
:for is applied for previous defined command.
Examples
exclusive do
option :one
option :two
end
Or
option :one
option :two
exclusive :one, :two
If you give “–one” and “–two” at the same time ExclusiveArgumentsError will be raised.
203 204 205 206 |
# File 'lib/bundler/vendor/thor/lib/thor.rb', line 203 def method_exclusive(*args, &block) (:method_options, :method_exclusive_option_names, *args, &block) end |