diff --git a/ChangeLog b/ChangeLog index b9f851b060..9f4ac091b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Nov 27 11:29:24 2010 Nobuyoshi Nakada + + * lib/optparse.rb (OptionParser#candidate): get rid of 1.9 syntax + so that BASERUBY can be 1.8. + Sat Nov 27 08:16:21 2010 Nobuyoshi Nakada * addr2line.c (rb_dump_backtrace_with_lines): should close fd on 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)