зеркало из https://github.com/github/ruby.git
* lib/optparse.rb (parse_in_order): splat values to be passed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
67cd02b40c
Коммит
8cd6a45a2a
|
@ -1,3 +1,7 @@
|
|||
Sun Dec 21 14:45:58 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/optparse.rb (parse_in_order): splat values to be passed.
|
||||
|
||||
Sun Dec 21 13:50:37 2008 TAKAO Kouji <kouji@takao7.net>
|
||||
|
||||
* test/readline/test_readline.rb
|
||||
|
|
|
@ -1263,7 +1263,7 @@ class OptionParser
|
|||
end
|
||||
begin
|
||||
opt, cb, val = sw.parse(rest, argv) {|*exc| raise(*exc)}
|
||||
val = cb.call(val) if cb
|
||||
val = cb.call(*val) if cb
|
||||
setter.call(sw.switch_name, val) if setter
|
||||
rescue ParseError
|
||||
raise $!.set_option(arg, rest)
|
||||
|
@ -1294,7 +1294,7 @@ class OptionParser
|
|||
opt, cb, val = sw.parse(val, argv) {|*exc| raise(*exc) if eq}
|
||||
raise InvalidOption, arg if has_arg and !eq and arg == "-#{opt}"
|
||||
argv.unshift(opt) if opt and (opt = opt.sub(/\A-*/, '-')) != '-'
|
||||
val = cb.call(val) if cb
|
||||
val = cb.call(*val) if cb
|
||||
setter.call(sw.switch_name, val) if setter
|
||||
rescue ParseError
|
||||
raise $!.set_option(arg, arg.length > 2)
|
||||
|
|
Загрузка…
Ссылка в новой задаче