tools: Fix argparse table of gpgconf.

* tools/gpgconf.c (opts): Use ARGPARSE macros.

--

GnuPG-bug-id: 6902
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2023-12-25 10:07:07 +09:00
parent 431239b83d
commit 2be53b214d
No known key found for this signature in database
GPG Key ID: 640114AF89DE6054
1 changed files with 36 additions and 34 deletions

View File

@ -86,30 +86,31 @@ enum cmd_and_opt_values
/* The list of commands and options. */ /* The list of commands and options. */
static gpgrt_opt_t opts[] = static gpgrt_opt_t opts[] =
{ {
{ 300, NULL, 0, N_("@Commands:\n ") }, ARGPARSE_group (300, N_("@Commands:\n ")),
{ aListComponents, "list-components", 256, N_("list all components") }, ARGPARSE_c (aListComponents, "list-components", N_("list all components")),
{ aCheckPrograms, "check-programs", 256, N_("check all programs") }, ARGPARSE_c (aCheckPrograms, "check-programs", N_("check all programs")),
{ aListOptions, "list-options", 256, N_("|COMPONENT|list options") }, ARGPARSE_c (aListOptions, "list-options", N_("|COMPONENT|list options")),
{ aChangeOptions, "change-options", 256, N_("|COMPONENT|change options") }, ARGPARSE_c (aChangeOptions, "change-options",
{ aCheckOptions, "check-options", 256, N_("|COMPONENT|check options") }, N_("|COMPONENT|change options")),
{ aApplyDefaults, "apply-defaults", 256, ARGPARSE_c (aCheckOptions, "check-options", N_("|COMPONENT|check options")),
N_("apply global default values") }, ARGPARSE_c (aApplyDefaults, "apply-defaults",
{ aApplyProfile, "apply-profile", 256, N_("apply global default values")),
N_("|FILE|update configuration files using FILE") }, ARGPARSE_c (aApplyProfile, "apply-profile",
{ aListDirs, "list-dirs", 256, N_("|FILE|update configuration files using FILE")),
N_("get the configuration directories for @GPGCONF@") }, ARGPARSE_c (aListDirs, "list-dirs",
{ aListConfig, "list-config", 256, N_("get the configuration directories for @GPGCONF@")),
N_("list global configuration file") }, ARGPARSE_c (aListConfig, "list-config",
{ aCheckConfig, "check-config", 256, N_("list global configuration file")),
N_("check global configuration file") }, ARGPARSE_c (aCheckConfig, "check-config",
{ aQuerySWDB, "query-swdb", 256, N_("check global configuration file")),
N_("query the software version database") }, ARGPARSE_c (aQuerySWDB, "query-swdb",
{ aReload, "reload", 256, N_("reload all or a given component")}, N_("query the software version database")),
{ aLaunch, "launch", 256, N_("launch a given component")}, ARGPARSE_c (aReload, "reload", N_("reload all or a given component")),
{ aKill, "kill", 256, N_("kill a given component")}, ARGPARSE_c (aLaunch, "launch", N_("launch a given component")),
{ aCreateSocketDir, "create-socketdir", 256, "@"}, ARGPARSE_c (aKill, "kill", N_("kill a given component")),
{ aRemoveSocketDir, "remove-socketdir", 256, "@"}, ARGPARSE_c (aCreateSocketDir, "create-socketdir", "@"),
ARGPARSE_c (aRemoveSocketDir, "remove-socketdir", "@"),
ARGPARSE_c (aShowVersions, "show-versions", ""), ARGPARSE_c (aShowVersions, "show-versions", ""),
ARGPARSE_c (aShowConfigs, "show-configs", ""), ARGPARSE_c (aShowConfigs, "show-configs", ""),
/* hidden commands: for debugging */ /* hidden commands: for debugging */
@ -117,24 +118,25 @@ static gpgrt_opt_t opts[] =
ARGPARSE_c (aDotlockLock, "lock", "@"), ARGPARSE_c (aDotlockLock, "lock", "@"),
ARGPARSE_c (aDotlockUnlock, "unlock", "@"), ARGPARSE_c (aDotlockUnlock, "unlock", "@"),
{ 301, NULL, 0, N_("@\nOptions:\n ") }, ARGPARSE_header (NULL, N_("@\nOptions:\n ")),
{ oOutput, "output", 2, N_("use as output file") }, ARGPARSE_s_s (oOutput, "output", N_("use as output file")),
{ oVerbose, "verbose", 0, N_("verbose") }, ARGPARSE_s_n (oVerbose, "verbose", N_("verbose")),
{ oQuiet, "quiet", 0, N_("quiet") }, ARGPARSE_s_n (oQuiet, "quiet", N_("quiet")),
{ oDryRun, "dry-run", 0, N_("do not make any changes") }, ARGPARSE_s_n (oDryRun, "dry-run", N_("do not make any changes")),
{ oRuntime, "runtime", 0, N_("activate changes at runtime, if possible") }, ARGPARSE_s_n (oRuntime, "runtime",
N_("activate changes at runtime, if possible")),
ARGPARSE_s_i (oStatusFD, "status-fd", ARGPARSE_s_i (oStatusFD, "status-fd",
N_("|FD|write status info to this FD")), N_("|FD|write status info to this FD")),
/* hidden options */ /* hidden options */
{ oHomedir, "homedir", 2, "@" }, ARGPARSE_s_s (oHomedir, "homedir", "@"),
{ oBuilddir, "build-prefix", 2, "@" }, ARGPARSE_s_s (oBuilddir, "build-prefix", "@"),
{ oNull, "null", 0, "@" }, ARGPARSE_s_n (oNull, "null", "@"),
{ oNoVerbose, "no-verbose", 0, "@"}, ARGPARSE_s_n (oNoVerbose, "no-verbose", "@"),
ARGPARSE_s_n (oShowSocket, "show-socket", "@"), ARGPARSE_s_n (oShowSocket, "show-socket", "@"),
ARGPARSE_s_s (oChUid, "chuid", "@"), ARGPARSE_s_s (oChUid, "chuid", "@"),
ARGPARSE_end(), ARGPARSE_end ()
}; };