mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Fix default argument values for OptParse::Switch#summarize
The documentation describes these arguments being hashes, and the method is called with hashes, so a hash default makes more sense. The method would fail previously if called without arguments and @short or @long contained a non-integer value. Fixes [Bug #10928]
This commit is contained in:
parent
c1ebb384fd
commit
3fcffceafd
1 changed files with 1 additions and 1 deletions
|
|
@ -592,7 +592,7 @@ class OptionParser
|
|||
# +max+ columns.
|
||||
# +indent+:: Prefix string indents all summarized lines.
|
||||
#
|
||||
def summarize(sdone = [], ldone = [], width = 1, max = width - 1, indent = "")
|
||||
def summarize(sdone = {}, ldone = {}, width = 1, max = width - 1, indent = "")
|
||||
sopts, lopts = [], [], nil
|
||||
@short.each {|s| sdone.fetch(s) {sopts << s}; sdone[s] = true} if @short
|
||||
@long.each {|s| ldone.fetch(s) {lopts << s}; ldone[s] = true} if @long
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue