Class: CTioga2::Commands::CommandArgument
- Inherits:
-
Object
- Object
- CTioga2::Commands::CommandArgument
- Defined in:
- lib/ctioga2/commands/arguments.rb
Overview
There should be real options mangling capacities, with:
An argument to a Command
-
(possibly deprecated) aliases for options
-
_ to - mangling
-
other things ?
Instance Attribute Summary collapse
-
#description ⇒ Object
A small description of the argument.
-
#name ⇒ Object
The name of the argument.
-
#option_deprecated ⇒ Object
Whether or not the option is deprecated.
-
#option_target ⇒ Object
The target for the option, in case it is different from its name.
-
#type ⇒ Object
The type of the argument, a CommandType object.
Instance Method Summary collapse
-
#displayed_name ⇒ Object
Returns a name suitable for display in a documentation, such as the command-line help.
-
#initialize(type, name = nil, desc = nil) ⇒ CommandArgument
constructor
type is a named CommandType.
Constructor Details
#initialize(type, name = nil, desc = nil) ⇒ CommandArgument
type is a named CommandType
49 50 51 52 53 54 55 56 |
# File 'lib/ctioga2/commands/arguments.rb', line 49 def initialize(type, name = nil, desc = nil) @type = CommandType.get_type(type) @name = name @description = desc @option_target = nil @option_deprecated = false end |
Instance Attribute Details
#description ⇒ Object
A small description of the argument
39 40 41 |
# File 'lib/ctioga2/commands/arguments.rb', line 39 def description @description end |
#name ⇒ Object
The name of the argument. Uniquely for display in the help documentation.
36 37 38 |
# File 'lib/ctioga2/commands/arguments.rb', line 36 def name @name end |
#option_deprecated ⇒ Object
Whether or not the option is deprecated
46 47 48 |
# File 'lib/ctioga2/commands/arguments.rb', line 46 def option_deprecated @option_deprecated end |
#option_target ⇒ Object
The target for the option, in case it is different from its name
43 44 45 |
# File 'lib/ctioga2/commands/arguments.rb', line 43 def option_target @option_target end |
#type ⇒ Object
The type of the argument, a CommandType object.
32 33 34 |
# File 'lib/ctioga2/commands/arguments.rb', line 32 def type @type end |
Instance Method Details
#displayed_name ⇒ Object
Returns a name suitable for display in a documentation, such as the command-line help.
60 61 62 63 64 65 66 |
# File 'lib/ctioga2/commands/arguments.rb', line 60 def displayed_name if @name return @name else return @type.name end end |