Class: GLI::CommandLineOption

Inherits:
Object
  • Object
show all
Defined in:
lib/gli_patches.rb

Instance Method Summary collapse

Constructor Details

#initialize(names, options = {}) ⇒ CommandLineOption

Returns a new instance of CommandLineOption.



21
22
23
24
25
26
27
28
# File 'lib/gli_patches.rb', line 21

def initialize(names, options = {})
  # Disable returning a default for this option (needed for boolean updates)
  # which should NOT be sent unless added by the user
  @ignore_default = !!options[:ignore_default]

  super(names, options[:desc], options[:long_desc])
  @default_value = options[:default_value]
end

Instance Method Details

#ignore_default?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/gli_patches.rb', line 30

def ignore_default?
  @ignore_default
end