| Class | OptionParser::Switch::PlacedArgument |
| In: |
lib/optparse.rb
|
| Parent: | self |
Returns nil if argument is not present or begins with ’-’.
# File lib/optparse.rb, line 468
468: def parse(arg, argv, &error)
469: if !(val = arg) and (argv.empty? or /\A-/ =~ (val = argv[0]))
470: return nil, block, nil
471: end
472: opt = (val = parse_arg(val, &error))[1]
473: val = conv_arg(*val)
474: if opt and !arg
475: argv.shift
476: else
477: val[0] = nil
478: end
479: val
480: end