diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-11-04 20:17:06 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-11-04 20:17:06 +0000 |
commit | ed823523e32e8e8a04123ee5b8ec9c0f3de63c02 (patch) | |
tree | b47e663e8dff55d03b47711001718a9b1f6557c4 | |
parent | 950c618335a3e74fd5907e7af2b8812c67d3ad33 (diff) |
* 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/trunk@13823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/optparse.rb | 2 |
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,9 @@ +Mon Nov 5 05:17:04 2007 Nobuyoshi Nakada <[email protected]> + + * 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]. + Mon Nov 5 01:20:33 2007 Yukihiro Matsumoto <[email protected]> * parse.y (call_args): remove "parenthesize argument(s) for future diff --git a/lib/optparse.rb b/lib/optparse.rb index 6fddb81a72..d33ad536e2 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 |