Class: GLI::GLIOptionParser::LegacyCommandOptionParser

Inherits:
NormalCommandOptionParser show all
Defined in:
lib/gli/gli_option_parser.rb

Instance Method Summary collapse

Methods inherited from NormalCommandOptionParser

#error_handler, #initialize

Methods inherited from GlobalOptionParser

#initialize

Constructor Details

This class inherits a constructor from GLI::GLIOptionParser::NormalCommandOptionParser

Instance Method Details

#parse!(parsing_result, argument_handling_strategy, autocomplete) ⇒ Object



195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/gli/gli_option_parser.rb', line 195

def parse!(parsing_result,argument_handling_strategy,autocomplete)
  command                     = parsing_result.command
  option_parser_factory       = OptionParserFactory.for_command(command,@accepts)
  option_block_parser         = LegacyCommandOptionBlockParser.new(option_parser_factory, self.error_handler)
  option_block_parser.command = command

  parsing_result.arguments       = option_block_parser.parse!(parsing_result.arguments)
  parsing_result.command_options = option_parser_factory.options_hash_with_defaults_set!

  subcommand,args                = find_subcommand(command,parsing_result.arguments,autocomplete)
  parsing_result.command         = subcommand
  parsing_result.arguments       = args
  verify_required_options!(command.flags, parsing_result.command, parsing_result.command_options)
end