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
50 51 52 53 54 55 56 57 |
# File 'lib/ctioga2/commands/arguments.rb', line 50 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
37 38 39 |
# File 'lib/ctioga2/commands/arguments.rb', line 37 def description @description end |
#name ⇒ Object
The name of the argument. Uniquely for display in the help documentation.
34 35 36 |
# File 'lib/ctioga2/commands/arguments.rb', line 34 def name @name end |
#option_deprecated ⇒ Object
Whether or not the option is deprecated.
If evaluates as true and different from true, is converted into a string used as an explanation to the user
47 48 49 |
# File 'lib/ctioga2/commands/arguments.rb', line 47 def option_deprecated @option_deprecated end |
#option_target ⇒ Object
The target for the option, in case it is different from its name
41 42 43 |
# File 'lib/ctioga2/commands/arguments.rb', line 41 def option_target @option_target end |
#type ⇒ Object
The type of the argument, a CommandType object.
30 31 32 |
# File 'lib/ctioga2/commands/arguments.rb', line 30 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.
61 62 63 64 65 66 67 |
# File 'lib/ctioga2/commands/arguments.rb', line 61 def displayed_name if @name return @name else return @type.name end end |