summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-07 18:07:00 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-07 18:07:00 +0000
commit0c7a99724f444ce83492d522c36f3f94d617acb3 (patch)
tree921cd0dbcfb52b7e61b658f1d7c990ba79cb3ae9 /lib
parent5d53d594f08e23e1efd9cd5dbbd2731bea02a1bf (diff)
merge revision(s) 13823:
* lib/optparse.rb (OptionParser::Switch::summarize): fix for long form option with very long argument. a patch from Kobayashi Noritada <nori1 AT dolphin.c.u-tokyo.ac.jp> in [ruby-list:44179]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@16921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/optparse.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/optparse.rb b/lib/optparse.rb
index c1df9586c8..d5a759d084 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -383,7 +383,7 @@ class OptionParser
while s = lopts.shift
l = left[-1].length + s.length
l += arg.length if left.size == 1 && arg
- l < max or left << ''
+ l < max or sopts.empty? or left << ''
left[-1] << if left[-1].empty? then ' ' * 4 else ', ' end << s
end