[tor-commits] [tor/master] Use C99 struct-initializer syntax in COMMANDLINE_ONLY_OPTIONS

nickm at torproject.org nickm at torproject.org
Thu Oct 17 16:01:55 UTC 2019


commit bd5ce112c92b81a98023513a53ecd64cf44122fe
Author: Nick Mathewson <nickm at torproject.org>
Date:   Tue Oct 8 10:54:57 2019 -0400

    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 44d6a82e5..26b104802 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 },
 };
 





More information about the tor-commits mailing list