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.
This commit is contained in:
Nick Mathewson 2019-10-08 10:54:57 -04:00
parent 6cea2bd498
commit bd5ce112c9

View File

@ -2463,30 +2463,36 @@ static const struct {
const char *name; const char *name;
takes_argument_t takes_argument; takes_argument_t takes_argument;
} CMDLINE_ONLY_OPTIONS[] = { } CMDLINE_ONLY_OPTIONS[] = {
{ "-f", ARGUMENT_NECESSARY }, { .name="-f",
{ "--allow-missing-torrc", ARGUMENT_NONE }, .takes_argument=ARGUMENT_NECESSARY },
{ "--defaults-torrc", ARGUMENT_NECESSARY }, { .name="--allow-missing-torrc" },
{ "--hash-password", ARGUMENT_NECESSARY }, { .name="--defaults-torrc",
{ "--dump-config", ARGUMENT_OPTIONAL }, .takes_argument=ARGUMENT_NECESSARY },
{ "--list-fingerprint", ARGUMENT_NONE }, { .name="--hash-password",
{ "--keygen", ARGUMENT_NONE }, .takes_argument=ARGUMENT_NECESSARY },
{ "--key-expiration", ARGUMENT_OPTIONAL }, { .name="--dump-config",
{ "--newpass", ARGUMENT_NONE }, .takes_argument=ARGUMENT_OPTIONAL },
{ "--no-passphrase", ARGUMENT_NONE }, { .name="--list-fingerprint" },
{ "--passphrase-fd", ARGUMENT_NECESSARY }, { .name="--keygen" },
{ "--verify-config", ARGUMENT_NONE }, { .name="--key-expiration",
{ "--ignore-missing-torrc", ARGUMENT_NONE }, .takes_argument=ARGUMENT_OPTIONAL },
{ "--quiet", ARGUMENT_NONE }, { .name="--newpass" },
{ "--hush", ARGUMENT_NONE }, { .name="--no-passphrase" },
{ "--version", ARGUMENT_NONE }, { .name="--passphrase-fd",
{ "--list-modules", ARGUMENT_NONE }, .takes_argument=ARGUMENT_NECESSARY },
{ "--library-versions", ARGUMENT_NONE }, { .name="--verify-config" },
{ "-h", ARGUMENT_NONE }, { .name="--ignore-missing-torrc" },
{ "--help", ARGUMENT_NONE }, { .name="--quiet" },
{ "--list-torrc-options", ARGUMENT_NONE }, { .name="--hush" },
{ "--list-deprecated-options",ARGUMENT_NONE }, { .name="--version" },
{ "--nt-service", ARGUMENT_NONE }, { .name="--list-modules" },
{ "-nt-service", ARGUMENT_NONE }, { .name="--library-versions" },
{ .name="-h" },
{ .name="--help" },
{ .name="--list-torrc-options" },
{ .name="--list-deprecated-options" },
{ .name="--nt-service" },
{ .name="-nt-service" },
{ NULL, 0 }, { NULL, 0 },
}; };