Class: ParseArgv::Result::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/parse-argv.rb

Overview

Represents a command with a name and related help text

Instance Attribute Summary collapse

Instance Attribute Details

#full_nameString (readonly)

Returns complete command name.

Returns:

  • (String)

    complete command name



150
151
152
# File 'lib/parse-argv.rb', line 150

def full_name
  @full_name
end

#helpString (readonly)

Returns help text of the command.

Returns:

  • (String)

    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

#nameString (readonly) Also known as: to_s

Returns subcommand name.

Returns:

  • (String)

    subcommand name



154
155
156
# File 'lib/parse-argv.rb', line 154

def name
  @name
end