]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Use C99 struct-initializer syntax in COMMANDLINE_ONLY_OPTIONS
authorNick Mathewson <nickm@torproject.org>
Tue, 8 Oct 2019 14:54:57 +0000 (10:54 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 8 Oct 2019 16:59:22 +0000 (12:59 -0400)
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

index 44d6a82e56dac5993ea72dd70276716097f8748f..26b1048022548c41297e75dbd29c6b8c8732549d 100644 (file)
@@ -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 },
 };