aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--parse-options.c4
-rwxr-xr-xt/t0040-parse-options.sh3
2 files changed, 4 insertions, 3 deletions
diff --git a/parse-options.c b/parse-options.c
index 817416db99..87c9fae634 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -1146,7 +1146,9 @@ static enum parse_opt_result usage_with_options_internal(struct parse_opt_ctx_t
!(opts->flags & PARSE_OPT_NOARG))
pos += usage_argh(opts, outfile);
- if (pos <= USAGE_OPTS_WIDTH)
+ if (pos == USAGE_OPTS_WIDTH + 1)
+ pad = -1;
+ else if (pos <= USAGE_OPTS_WIDTH)
pad = USAGE_OPTS_WIDTH - pos;
else {
fputc('\n', outfile);
diff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh
index 83e5d4eeb6..e19a199636 100755
--- a/t/t0040-parse-options.sh
+++ b/t/t0040-parse-options.sh
@@ -30,8 +30,7 @@ usage: test-tool parse-options <options>
-F, --file <file> set file to <file>
String options
- -s, --string <string>
- get a string
+ -s, --string <string> get a string
--string2 <str> get another string
--st <st> get another string (pervert ordering)
-o <str> get another string