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

* lib/optparse.rb (OptionParser#candidate): skip separators.

* sample/optparse/opttest.rb: should not override --help.
  [ruby-dev:42690]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-12-06 13:47:19 +00:00
parent 6c715d1de8
commit 76c286d195
3 changed files with 9 additions and 1 deletions

View file

@ -1,3 +1,10 @@
Mon Dec 6 22:47:15 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* 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@mbf.nifty.com>
* misc/rb_optparse.zsh: fix typos.

View file

@ -1549,6 +1549,7 @@ XXX
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

2
sample/optparse/opttest.rb Normal file → Executable file
View file

@ -18,7 +18,7 @@ ARGV.options do
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,