]> Savannah Git Hosting - gnulib.git/commitdiff
argmatch: adjust columns for help2man.
authorAkim Demaille <akim.demaille@gmail.com>
Sun, 7 Jul 2019 10:12:25 +0000 (12:12 +0200)
committerAkim Demaille <akim.demaille@gmail.com>
Sun, 7 Jul 2019 10:12:25 +0000 (12:12 +0200)
* lib/argmatch.h (argmatch_##Name##_doc_col): If some argument
requires column 20 or more, return 20.

ChangeLog
lib/argmatch.h

index f7e031d9bf31920befd5da6e7a1ecebd02bf55a0..01696987f69c26ff0a53ea82ae0d4b5c29fa0a83 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-07-07  Akim Demaille  <akim@lrde.epita.fr>
+
+       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  <eggert@cs.ucla.edu>
 
        areadlink-with-size: avoid realloc when size==0
index 57d131f32d129614b480e9724dd95a282d73c8fb..897fa415d6927dad7f956c25c29657d1e544e190 100644 (file)
@@ -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;                                              \
   }                                                                     \