Rename TAKES_NO_ARGUMENT to ARGUMENT_NONE.

I'm doing this for consistency, so that all the values for this enum
have the same prefix.

This is an automated commit, generated by the following shell commands:

for fn in $(git ls-tree --name-only -r HEAD src |grep '\.[ch]$'); do \
    perl -i -pe 's!\bTAKES_NO_ARGUMENT\b!ARGUMENT_NONE!g;' "$fn"; \
done
This commit is contained in:
Nick Mathewson 2019-10-08 10:46:16 -04:00
parent c42a79499a
commit 4c25ea6703

View file

@ -2448,7 +2448,7 @@ options_act(const or_options_t *old_options)
} }
typedef enum { typedef enum {
TAKES_NO_ARGUMENT = 0, ARGUMENT_NONE = 0,
ARGUMENT_NECESSARY = 1, ARGUMENT_NECESSARY = 1,
ARGUMENT_OPTIONAL = 2 ARGUMENT_OPTIONAL = 2
} takes_argument_t; } takes_argument_t;
@ -2458,29 +2458,29 @@ static const struct {
takes_argument_t takes_argument; takes_argument_t takes_argument;
} CMDLINE_ONLY_OPTIONS[] = { } CMDLINE_ONLY_OPTIONS[] = {
{ "-f", ARGUMENT_NECESSARY }, { "-f", ARGUMENT_NECESSARY },
{ "--allow-missing-torrc", TAKES_NO_ARGUMENT }, { "--allow-missing-torrc", ARGUMENT_NONE },
{ "--defaults-torrc", ARGUMENT_NECESSARY }, { "--defaults-torrc", ARGUMENT_NECESSARY },
{ "--hash-password", ARGUMENT_NECESSARY }, { "--hash-password", ARGUMENT_NECESSARY },
{ "--dump-config", ARGUMENT_OPTIONAL }, { "--dump-config", ARGUMENT_OPTIONAL },
{ "--list-fingerprint", TAKES_NO_ARGUMENT }, { "--list-fingerprint", ARGUMENT_NONE },
{ "--keygen", TAKES_NO_ARGUMENT }, { "--keygen", ARGUMENT_NONE },
{ "--key-expiration", ARGUMENT_OPTIONAL }, { "--key-expiration", ARGUMENT_OPTIONAL },
{ "--newpass", TAKES_NO_ARGUMENT }, { "--newpass", ARGUMENT_NONE },
{ "--no-passphrase", TAKES_NO_ARGUMENT }, { "--no-passphrase", ARGUMENT_NONE },
{ "--passphrase-fd", ARGUMENT_NECESSARY }, { "--passphrase-fd", ARGUMENT_NECESSARY },
{ "--verify-config", TAKES_NO_ARGUMENT }, { "--verify-config", ARGUMENT_NONE },
{ "--ignore-missing-torrc", TAKES_NO_ARGUMENT }, { "--ignore-missing-torrc", ARGUMENT_NONE },
{ "--quiet", TAKES_NO_ARGUMENT }, { "--quiet", ARGUMENT_NONE },
{ "--hush", TAKES_NO_ARGUMENT }, { "--hush", ARGUMENT_NONE },
{ "--version", TAKES_NO_ARGUMENT }, { "--version", ARGUMENT_NONE },
{ "--list-modules", TAKES_NO_ARGUMENT }, { "--list-modules", ARGUMENT_NONE },
{ "--library-versions", TAKES_NO_ARGUMENT }, { "--library-versions", ARGUMENT_NONE },
{ "-h", TAKES_NO_ARGUMENT }, { "-h", ARGUMENT_NONE },
{ "--help", TAKES_NO_ARGUMENT }, { "--help", ARGUMENT_NONE },
{ "--list-torrc-options", TAKES_NO_ARGUMENT }, { "--list-torrc-options", ARGUMENT_NONE },
{ "--list-deprecated-options",TAKES_NO_ARGUMENT }, { "--list-deprecated-options",ARGUMENT_NONE },
{ "--nt-service", TAKES_NO_ARGUMENT }, { "--nt-service", ARGUMENT_NONE },
{ "-nt-service", TAKES_NO_ARGUMENT }, { "-nt-service", ARGUMENT_NONE },
{ NULL, 0 }, { NULL, 0 },
}; };
@ -2552,7 +2552,7 @@ config_parse_commandline(int argc, char **argv, int ignore_errors,
} else if (want_arg == ARGUMENT_OPTIONAL && is_last) { } else if (want_arg == ARGUMENT_OPTIONAL && is_last) {
arg = tor_strdup(""); arg = tor_strdup("");
} else { } else {
arg = (want_arg != TAKES_NO_ARGUMENT) ? tor_strdup(argv[i+1]) : arg = (want_arg != ARGUMENT_NONE) ? tor_strdup(argv[i+1]) :
tor_strdup(""); tor_strdup("");
} }