Method: YARD::CLI::Command#parse_options

Defined in:
lib/yard/cli/command.rb

#parse_options(opts, args) ⇒ void (protected)

This method returns an undefined value.

Parses the option and gracefully handles invalid switches

Parameters:

  • opts (OptionParser)

    the option parser object

  • args (Array<String>)

    the arguments passed from input. This array will be modified.

Since:

  • 0.6.0


51
52
53
54
55
56
57
# File 'lib/yard/cli/command.rb', line 51

def parse_options(opts, args)
  opts.parse!(args)
rescue OptionParser::ParseError => err
  log.warn "Unrecognized/#{err.message}"
  args.shift if args.first && args.first[0,1] != '-'
  retry
end