ruby-changes:18077
From: nobu <ko1@a...>
Date: Mon, 6 Dec 2010 22:53:36 +0900 (JST)
Subject: [ruby-changes:18077] Ruby:r30098 (trunk): * lib/optparse.rb (OptionParser#candidate): skip separators.
nobu 2010-12-06 22:47:19 +0900 (Mon, 06 Dec 2010) New Revision: 30098 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30098 Log: * lib/optparse.rb (OptionParser#candidate): skip separators. * sample/optparse/opttest.rb: should not override --help. [ruby-dev:42690] Modified files: trunk/ChangeLog trunk/lib/optparse.rb trunk/sample/optparse/opttest.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 30097) +++ ChangeLog (revision 30098) @@ -1,3 +1,10 @@ +Mon Dec 6 22:47:15 2010 Nobuyoshi Nakada <nobu@r...> + + * lib/optparse.rb (OptionParser#candidate): skip separators. + + * sample/optparse/opttest.rb: should not override --help. + [ruby-dev:42690] + Mon Dec 6 19:00:48 2010 Kazuhiro NISHIYAMA <zn@m...> * misc/rb_optparse.zsh: fix typos. Index: sample/optparse/opttest.rb =================================================================== --- sample/optparse/opttest.rb (revision 30097) +++ sample/optparse/opttest.rb (revision 30098) @@ -18,7 +18,7 @@ opts.on_tail("common options:") # no argument, shows at tail - opts.on_tail("--help", "show this message") {puts opts; exit} + opts.on_tail("--usage", "show this message") {puts opts; exit} # mandatory argument opts.on("-r", "--require=LIBRARY", String, Property changes on: sample/optparse/opttest.rb ___________________________________________________________________ Added: svn:executable + * Index: lib/optparse.rb =================================================================== --- lib/optparse.rb (revision 30097) +++ lib/optparse.rb (revision 30098) @@ -1549,6 +1549,7 @@ end pat = Completion.regexp(word, true) visit(:each_option) do |opt| + next unless Switch === opt opts = (long ? opt.long : []) + (short ? opt.short : []) opts = Completion.candidate(word, true, pat, &opts.method(:each)).map(&:first) if pat if /\A=/ =~ opt.arg -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/