From 962862267a52e608a7cbff5910d941c5479efa68 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sat, 22 Jun 2019 08:37:31 +0200 Subject: [PATCH] argmatch: put all the docs member last. Reported by Bruno Haible. * lib/argmatch.h (argmatch_##Name##_group_type): Put the args member before the docs done. * doc/argmatch.texi, tests/test-argmatch.c: Adjust. --- ChangeLog | 8 ++++++++ doc/argmatch.texi | 2 +- lib/argmatch.h | 18 +++++++++--------- tests/test-argmatch.c | 2 +- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index d0a6a22a13..cdc2b3d7ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2019-06-22 Akim Demaille + + argmatch: put all the docs member last. + Reported by Bruno Haible. + * lib/argmatch.h (argmatch_##Name##_group_type): Put the args + member before the docs done. + * doc/argmatch.texi, tests/test-argmatch.c: Adjust. + 2019-06-21 Akim Demaille argmatch: add support to generate the usage message. diff --git a/doc/argmatch.texi b/doc/argmatch.texi index 9222520702..94787fabf7 100644 --- a/doc/argmatch.texi +++ b/doc/argmatch.texi @@ -92,8 +92,8 @@ Finally, define the argmatch group: @example const argmatch_backup_group_type argmatch_backup_group = @{ - argmatch_backup_docs, argmatch_backup_args, + argmatch_backup_docs, N_("\ The backup suffix is '~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.\n\ The version control method may be selected via the --backup option or through\n\ diff --git a/lib/argmatch.h b/lib/argmatch.h index 6f641aff4b..427d7179f6 100644 --- a/lib/argmatch.h +++ b/lib/argmatch.h @@ -122,29 +122,29 @@ char const *argmatch_to_argument (void const *value, argmatch_##Name##_size = sizeof (argmatch_##Name##_type) \ }; \ \ - /* Documentation of this group. */ \ + /* Argument mapping of this group. */ \ typedef struct \ { \ /* Argument (e.g., "simple"). */ \ const char const *arg; \ - /* Documentation (e.g., N_("always make simple backups")). */ \ - const char const *doc; \ - } argmatch_##Name##_doc; \ + /* Value (e.g., simple_backups). */ \ + const argmatch_##Name##_type val; \ + } argmatch_##Name##_arg; \ \ - /* Argument mapping of this group. */ \ + /* Documentation of this group. */ \ typedef struct \ { \ /* Argument (e.g., "simple"). */ \ const char const *arg; \ - /* Value (e.g., simple_backups). */ \ - const argmatch_##Name##_type val; \ - } argmatch_##Name##_arg; \ + /* Documentation (e.g., N_("always make simple backups")). */ \ + const char const *doc; \ + } argmatch_##Name##_doc; \ \ /* All the features of an argmatch group. */ \ typedef struct \ { \ - const argmatch_##Name##_doc* docs; \ const argmatch_##Name##_arg* args; \ + const argmatch_##Name##_doc* docs; \ \ /* Printed before the usage message. */ \ const char *doc_pre; \ diff --git a/tests/test-argmatch.c b/tests/test-argmatch.c index 4c724f4cfe..0d19e97956 100644 --- a/tests/test-argmatch.c +++ b/tests/test-argmatch.c @@ -89,8 +89,8 @@ static const argmatch_backup_arg argmatch_backup_args[] = const argmatch_backup_group_type argmatch_backup_group = { - argmatch_backup_docs, argmatch_backup_args, + argmatch_backup_docs, N_("\ The backup suffix is '~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.\n\ The version control method may be selected via the --backup option or through\n\ -- 2.39.5