From b90259e99cbf2d0452b343d370556ee50fde293a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 27 Jun 2013 11:23:38 +0200 Subject: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/ArgParser.java | 5 ++++- src/argparser.bash | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ArgParser.java b/src/ArgParser.java index ac37a93..dbddd07 100644 --- a/src/ArgParser.java +++ b/src/ArgParser.java @@ -836,7 +836,7 @@ public class ArgParser if (maxfirstlen < opt.alternatives[0].length()) maxfirstlen = opt.alternatives[0].length(); } - String empty = " "; + empty += " "; while (empty.length() < maxfirstlen) empty += empty; empty = empty.substring(0, maxfirstlen); @@ -874,6 +874,9 @@ public class ArgParser col = len[0]; col += 8 - ((col - 4) & 7); int index = 0; + + if (maxfirstlen == 0) + empty = " "; while (empty.length() < col) empty += empty; empty = empty.substring(0, col); diff --git a/src/argparser.bash b/src/argparser.bash index 76e7d6b..70d6eb1 100644 --- a/src/argparser.bash +++ b/src/argparser.bash @@ -428,6 +428,7 @@ function args_help fi done col=$(( $col + 8 - (($col - 4) & 7) )) + empty="${empty} " while (( ${#empty} < $col )); do empty="${empty}${empty}" done -- cgit v1.2.3-70-g09d2