mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
[ruby/optparse] Fix completion of key-value pairs array
Enum array may be the list of pairs of key and value. Check if only
key is completable, not pair.
Fix https://github.com/ruby/optparse/pull/93
Fix https://github.com/ruby/optparse/pull/94
a8d0ba8dac
This commit is contained in:
parent
b5cdbadeed
commit
8f19f0aad5
2 changed files with 7 additions and 1 deletions
|
@ -1502,7 +1502,7 @@ XXX
|
|||
block = notwice(o, block, 'block')
|
||||
when Array, Hash
|
||||
if Array === o
|
||||
o, v = o.partition {|v| Completion.completable?(v)}
|
||||
o, v = o.partition {|v,| Completion.completable?(v)}
|
||||
values = notwice(v, values, 'values') unless v.empty?
|
||||
next if o.empty?
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue