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:
Jeremy Evans 2019-07-07 10:49:53 -07:00
Родитель c1ebb384fd
Коммит 3fcffceafd
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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