Class: Commands::GlobalFlagOption

Inherits:
CommandOption show all
Defined in:
lib/commands.rb

Instance Attribute Summary

Attributes inherited from CommandOption

#arg, #commands, #description, #name, #parent_commands

Instance Method Summary collapse

Methods inherited from CommandOption

#initialize

Constructor Details

This class inherits a constructor from Commands::CommandOption

Instance Method Details

#attach(command) ⇒ Object



730
731
732
733
734
735
736
737
738
# File 'lib/commands.rb', line 730

def attach(command)
  global_options = @commands.global_options
  value = global_options[@field_symbol]
  if value == nil then
    global_options[@field_symbol] = @arg
  else
    raise RuntimeError, "You may not specify #{@name} twice"
  end
end