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;
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 },
};