summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-27 02:29:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-27 02:29:26 +0000
commit7050069d8020684af2979cbf67b7702d4f7823fd (patch)
tree2c1df8241413c985864c02a95065c2443b69f9d4 /lib
parente394ddd2f720a8a39f25b5b2c6dad5e31ab2be36 (diff)
* lib/optparse.rb (OptionParser#candidate): get rid of 1.9 syntax
so that BASERUBY can be 1.8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/optparse.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/optparse.rb b/lib/optparse.rb
index b21bd935c7..91308a9aef 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -1549,10 +1549,10 @@ XXX
end
pat = Completion.regexp(word, true)
visit(:each_option) do |opt|
- opts = [*(opt.long if long), *(opt.short if short)]
+ opts = (long ? opt.long : []) + (short ? opt.short [])
opts = Completion.candidate(word, true, pat, &opts.method(:each)).map(&:first) if pat
if /\A=/ =~ opt.arg
- opts = opts.map {|sw| sw + "="}
+ opts.map! {|sw| sw + "="}
if arg and CompletingHash === opt.pattern
if opts = opt.pattern.candidate(arg, false, argpat)
opts.map!(&:last)