diff --git a/ChangeLog b/ChangeLog index a5f7f0aa2a..217c1d33c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Jan 31 18:03:41 2009 Nobuyoshi Nakada + + * lib/optparse.rb (List#accept, parse_in_order): n option is no + longer needed. + Sat Jan 31 14:12:43 2009 Tanaka Akira * lib/pathname.rb (Pathname#each_child): new method. diff --git a/lib/optparse.rb b/lib/optparse.rb index 0397382a6b..9c6b3924f0 100644 --- a/lib/optparse.rb +++ b/lib/optparse.rb @@ -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