class Cri::Command::ParserPartitioningDelegate

Delegate used for partitioning the list of arguments and options. This delegate will stop the parser as soon as the first argument, i.e. the command, is found.

@api private

Attributes

last_argument[R]

Returns the last parsed argument, which, in this case, will be the first argument, which will be either nil or the command name.

@return [String] The last parsed argument.

Public Instance Methods

argument_added(argument, parser) click to toggle source

Called when an argument is parsed.

@param [String] argument The argument

@param [Cri::Parser] parser The option parser

@return [void]

# File lib/cri/command.rb, line 37
def argument_added(argument, parser)
  @last_argument = argument
  parser.stop
end
option_added(_key, _value, _parser) click to toggle source

Called when an option is parsed.

@param [Symbol] _key The option key (derived from the long format)

@param _value The option value

@param [Cri::Parser] _parser The option parser

@return [void]

# File lib/cri/command.rb, line 28
def option_added(_key, _value, _parser); end