Feature #8460 » 0002-Move-dash-dash-handling-to-a-case.patch
lib/optparse.rb | ||
---|---|---|
ArgumentStyle.freeze
|
||
#
|
||
# Switches common used such as '--', and also provides default
|
||
# argument classes
|
||
# Provides default argument classes
|
||
#
|
||
DefaultList = List.new
|
||
DefaultList.short['-'] = Switch::NoArgument.new {}
|
||
DefaultList.long[''] = Switch::NoArgument.new {throw :terminate}
|
||
COMPSYS_HEADER = <<'XXX' # :nodoc:
|
||
... | ... | |
argv.unshift(arg) if arg = catch(:terminate) {
|
||
while arg = argv.shift
|
||
case arg
|
||
# dash dash
|
||
when /\A--\Z/m
|
||
break
|
||
# long option
|
||
when /\A--([^=]*)(?:=(.*))?/m
|
||
when /\A--([^=]+)(?:=(.*))?/m
|
||
opt, rest = $1, $2
|
||
opt.tr!('_', '-')
|
||
begin
|