From bd5ce112c92b81a98023513a53ecd64cf44122fe Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 8 Oct 2019 10:54:57 -0400 Subject: [PATCH] Use C99 struct-initializer syntax in COMMANDLINE_ONLY_OPTIONS I'm about to add more fields to this table, and this syntax change will make it easier to do so. --- src/app/config/config.c | 54 +++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/src/app/config/config.c b/src/app/config/config.c index 44d6a82e56..26b1048022 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -2463,30 +2463,36 @@ static const struct { const char *name; takes_argument_t takes_argument; } CMDLINE_ONLY_OPTIONS[] = { - { "-f", ARGUMENT_NECESSARY }, - { "--allow-missing-torrc", ARGUMENT_NONE }, - { "--defaults-torrc", ARGUMENT_NECESSARY }, - { "--hash-password", ARGUMENT_NECESSARY }, - { "--dump-config", ARGUMENT_OPTIONAL }, - { "--list-fingerprint", ARGUMENT_NONE }, - { "--keygen", ARGUMENT_NONE }, - { "--key-expiration", ARGUMENT_OPTIONAL }, - { "--newpass", ARGUMENT_NONE }, - { "--no-passphrase", ARGUMENT_NONE }, - { "--passphrase-fd", ARGUMENT_NECESSARY }, - { "--verify-config", ARGUMENT_NONE }, - { "--ignore-missing-torrc", ARGUMENT_NONE }, - { "--quiet", ARGUMENT_NONE }, - { "--hush", ARGUMENT_NONE }, - { "--version", ARGUMENT_NONE }, - { "--list-modules", ARGUMENT_NONE }, - { "--library-versions", ARGUMENT_NONE }, - { "-h", ARGUMENT_NONE }, - { "--help", ARGUMENT_NONE }, - { "--list-torrc-options", ARGUMENT_NONE }, - { "--list-deprecated-options",ARGUMENT_NONE }, - { "--nt-service", ARGUMENT_NONE }, - { "-nt-service", ARGUMENT_NONE }, + { .name="-f", + .takes_argument=ARGUMENT_NECESSARY }, + { .name="--allow-missing-torrc" }, + { .name="--defaults-torrc", + .takes_argument=ARGUMENT_NECESSARY }, + { .name="--hash-password", + .takes_argument=ARGUMENT_NECESSARY }, + { .name="--dump-config", + .takes_argument=ARGUMENT_OPTIONAL }, + { .name="--list-fingerprint" }, + { .name="--keygen" }, + { .name="--key-expiration", + .takes_argument=ARGUMENT_OPTIONAL }, + { .name="--newpass" }, + { .name="--no-passphrase" }, + { .name="--passphrase-fd", + .takes_argument=ARGUMENT_NECESSARY }, + { .name="--verify-config" }, + { .name="--ignore-missing-torrc" }, + { .name="--quiet" }, + { .name="--hush" }, + { .name="--version" }, + { .name="--list-modules" }, + { .name="--library-versions" }, + { .name="-h" }, + { .name="--help" }, + { .name="--list-torrc-options" }, + { .name="--list-deprecated-options" }, + { .name="--nt-service" }, + { .name="-nt-service" }, { NULL, 0 }, };