aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-06-27 11:23:38 +0200
committerMattias Andrée <maandree@operamail.com>2013-06-27 11:23:38 +0200
commitb90259e99cbf2d0452b343d370556ee50fde293a (patch)
tree51b3c28aa93c23140278a25f9031fc6e9e4f77bd
parentm bug fix + beginning of java test (diff)
downloadargparser-b90259e99cbf2d0452b343d370556ee50fde293a.tar.gz
argparser-b90259e99cbf2d0452b343d370556ee50fde293a.tar.bz2
argparser-b90259e99cbf2d0452b343d370556ee50fde293a.tar.xz
m
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--src/ArgParser.java5
-rw-r--r--src/argparser.bash1
2 files changed, 5 insertions, 1 deletions
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