Method: Bundler::Thor::Base::ClassMethods#class_exclusive

Defined in:
lib/bundler/vendor/thor/lib/thor/base.rb

#class_exclusive(*args, &block) ⇒ Object

Adds and declares option group for exclusive options in the block and arguments. You can declare options as the outside of the block.

Parameters

Array

Examples

class_exclusive do
  class_option :one
  class_option :two
 end

Or

class_option :one
class_option :two
class_exclusive :one, :two

If you give “–one” and “–two” at the same time ExclusiveArgumentsError will be raised.

[View source]

357
358
359
360
# File 'lib/bundler/vendor/thor/lib/thor/base.rb', line 357

def class_exclusive(*args, &block)
  register_options_relation_for(:class_options,
                                :class_exclusive_option_names, *args, &block)
end