summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-07 18:07:29 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-07 18:07:29 +0000
commitfd0f7b08cb550827355d86e9a26cb4186bb61b8f (patch)
tree468d8b79e4082f83fec5b3155b1980e7a81211b7 /lib
parent24a9bf988c896f073d0d483a117c4197f93006c2 (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_6@16923 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 2c91cd004f..417997d9bb 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -379,7 +379,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