1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/optparse.rb (List#accept, parse_in_order): n option is no

longer needed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-01-31 09:03:43 +00:00
parent fc77d9d1cb
commit de398e8f61
2 changed files with 9 additions and 4 deletions

View file

@ -1,3 +1,8 @@
Sat Jan 31 18:03:41 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/optparse.rb (List#accept, parse_in_order): n option is no
longer needed.
Sat Jan 31 14:12:43 2009 Tanaka Akira <akr@fsij.org>
* lib/pathname.rb (Pathname#each_child): new method.

View file

@ -528,7 +528,7 @@ class OptionParser
#
# See OptionParser.accept.
#
def accept(t, pat = /.*/nm, &block)
def accept(t, pat = /.*/m, &block)
if pat
pat.respond_to?(:match) or
raise TypeError, "has no `match'", ParseError.filter_backtrace(caller(2))
@ -1259,7 +1259,7 @@ class OptionParser
while arg = argv.shift
case arg
# long option
when /\A--([^=]*)(?:=(.*))?/nm
when /\A--([^=]*)(?:=(.*))?/m
opt, rest = $1, $2
begin
sw, = complete(:long, opt, true)
@ -1275,7 +1275,7 @@ class OptionParser
end
# short option
when /\A-(.)((=).*|.+)?/nm
when /\A-(.)((=).*|.+)?/m
opt, has_arg, eq, val, rest = $1, $3, $3, $2, $2
begin
sw, = search(:short, opt)
@ -1502,7 +1502,7 @@ class OptionParser
#
# Any non-empty string, and no conversion.
#
accept(String, /.+/nm) {|s,*|s}
accept(String, /.+/m) {|s,*|s}
#
# Ruby/C-like integer, octal for 0-7 sequence, binary for 0b, hexadecimal