Method: GLI::GLIOptionBlockParser#parse!

Defined in:
lib/gli/gli_option_block_parser.rb

#parse!(args) ⇒ Object

Parse the given argument list, returning the unparsed arguments and options hash of parsed arguments. Exceptions from OptionParser are given to the handler configured in the constructor

args

argument list. This will be mutated

Returns unparsed args



32
33
34
35
36
37
38
# File 'lib/gli/gli_option_block_parser.rb', line 32

def parse!(args)
  do_parse(args)
rescue OptionParser::InvalidOption => ex
  @exception_handler.call("Unknown option #{ex.args.join(' ')}",@extra_error_context)
rescue OptionParser::InvalidArgument => ex
  @exception_handler.call("#{ex.reason}: #{ex.args.join(' ')}",@extra_error_context)
end