Class: ParseArgv::Result::Command
- Inherits:
-
Object
- Object
- ParseArgv::Result::Command
- Defined in:
- lib/parse-argv.rb
Overview
Represents a command with a name and related help text
Instance Attribute Summary collapse
-
#full_name ⇒ String
readonly
Complete command name.
-
#help ⇒ String
readonly
Help text of the command.
-
#name ⇒ String
(also: #to_s)
readonly
Subcommand name.
Instance Attribute Details
#full_name ⇒ String (readonly)
Returns complete command name.
150 151 152 |
# File 'lib/parse-argv.rb', line 150 def full_name @full_name end |
#help ⇒ String (readonly)
Returns help text of the command.
165 166 167 168 169 170 |
# File 'lib/parse-argv.rb', line 165 def help return @help if @help.is_a?(String) @help.shift while @help[0]&.empty? @help.pop while @help[-1]&.empty? @help = @help.join("\n").freeze end |
#name ⇒ String (readonly) Also known as: to_s
Returns subcommand name.
154 155 156 |
# File 'lib/parse-argv.rb', line 154 def name @name end |