Class: KXI::CLI::ExplicitArgument
- Defined in:
- lib/kxi/cli/explicit_argument.rb
Overview
Represents argument specified explicitly with name
Direct Known Subclasses
Instance Method Summary collapse
-
#headline ⇒ String
Gets full descriptive name of argument.
-
#initialize(nm, desc, sh = nil, req = false) ⇒ ExplicitArgument
constructor
Instantiates the ExplicitArgument class.
-
#shortcut ⇒ String
Gets the shortcut symbol of argument.
-
#syntax ⇒ String
Gets syntax of argument.
Methods inherited from Argument
#description, #name, #order, #required?
Constructor Details
#initialize(nm, desc, sh = nil, req = false) ⇒ ExplicitArgument
Instantiates the KXI::CLI::ExplicitArgument class
33 34 35 36 |
# File 'lib/kxi/cli/explicit_argument.rb', line 33 def initialize(nm, desc, sh = nil, req = false) super(nm, desc, req, req ? 2 : 1) @sh = sh end |
Instance Method Details
#headline ⇒ String
Gets full descriptive name of argument
9 10 11 12 13 14 |
# File 'lib/kxi/cli/explicit_argument.rb', line 9 def headline ret = '' ret = "-#{@sh}, " if @sh != nil ret += "--#{name}" return ret end |
#shortcut ⇒ String
Gets the shortcut symbol of argument
24 25 26 |
# File 'lib/kxi/cli/explicit_argument.rb', line 24 def shortcut @sh end |
#syntax ⇒ String
Gets syntax of argument
18 19 20 |
# File 'lib/kxi/cli/explicit_argument.rb', line 18 def syntax headline end |