From: Akim Demaille Date: Sun, 7 Jul 2019 10:12:25 +0000 (+0200) Subject: argmatch: adjust columns for help2man. X-Git-Tag: v1.0~4768 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=ee77e5c1fef322b8c0a6596aa9b2c43323eff4d1;p=gnulib.git argmatch: adjust columns for help2man. * lib/argmatch.h (argmatch_##Name##_doc_col): If some argument requires column 20 or more, return 20. --- diff --git a/ChangeLog b/ChangeLog index f7e031d9bf..01696987f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2019-07-07 Akim Demaille + + argmatch: adjust columns for help2man. + * lib/argmatch.h (argmatch_##Name##_doc_col): If some argument + requires column 20 or more, return 20. + 2019-07-06 Paul Eggert areadlink-with-size: avoid realloc when size==0 diff --git a/lib/argmatch.h b/lib/argmatch.h index 57d131f32d..897fa415d6 100644 --- a/lib/argmatch.h +++ b/lib/argmatch.h @@ -264,9 +264,8 @@ char const *argmatch_to_argument (void const *value, for (int j = 0; g->args[j].arg; ++j) \ if (! memcmp (&g->args[ival].val, &g->args[j].val, size)) \ col += (col == 4 ? 0 : 2) + strlen (g->args[j].arg); \ - /* Ignore series that are too wide. */ \ - if (col <= 20 && res <= col) \ - res = col; \ + if (res <= col) \ + res = col <= 20 ? col : 20; \ } \ return res ? res : 20; \ } \