diff options
-rw-r--r-- | doc/tor.1.txt | 4 | ||||
-rw-r--r-- | src/or/config.c | 24 |
2 files changed, 23 insertions, 5 deletions
diff --git a/doc/tor.1.txt b/doc/tor.1.txt index b5d6e87683..530e8ca774 100644 --- a/doc/tor.1.txt +++ b/doc/tor.1.txt @@ -84,6 +84,10 @@ COMMAND-LINE OPTIONS [[opt-list-torrc-options]] **--list-torrc-options**:: List all valid options. +[[opt-list-deprecated-options]] **--list-deprecated-options**:: + List all valid options that are scheduled to become obsolete in a + future version. (This is a warning, not a promise.) + [[opt-version]] **--version**:: Display Tor version and exit. diff --git a/src/or/config.c b/src/or/config.c index cf1365a7ed..a5428aa231 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -603,9 +603,9 @@ static const config_deprecation_t option_deprecation_notes_[] = { "fingerprint." }, { "FastFirstHopPK", "Changing this option does not make your client more " "secure, but does make it easier to fingerprint." }, - { "CloseHSClientCircutisImmediatelyOnTimeout", "This option makes your " + { "CloseHSClientCircuitsImmediatelyOnTimeout", "This option makes your " "client easier to fingerprint." }, - { "CloseHSServiceRendircutisImmediatelyOnTimeout", "This option makes " + { "CloseHSServiceRendCircuitsImmediatelyOnTimeout", "This option makes " "your hidden services easier to fingerprint." }, { "WarnUnsafeSocks", "Changing this option makes it easier for you " "to accidentally lose your anonymity by leaking DNS information" }, @@ -2049,6 +2049,7 @@ static const struct { { "-h", TAKES_NO_ARGUMENT }, { "--help", TAKES_NO_ARGUMENT }, { "--list-torrc-options", TAKES_NO_ARGUMENT }, + { "--list-deprecated-options",TAKES_NO_ARGUMENT }, { "--nt-service", TAKES_NO_ARGUMENT }, { "-nt-service", TAKES_NO_ARGUMENT }, { NULL, 0 }, @@ -2235,7 +2236,6 @@ static void list_torrc_options(void) { int i; - smartlist_t *lines = smartlist_new(); for (i = 0; option_vars_[i].name; ++i) { const config_var_t *var = &option_vars_[i]; if (var->type == CONFIG_TYPE_OBSOLETE || @@ -2243,7 +2243,16 @@ list_torrc_options(void) continue; printf("%s\n", var->name); } - smartlist_free(lines); +} + +/** Print all deprecated but non-obsolete torrc options. */ +static void +list_deprecated_options(void) +{ + const config_deprecation_t *d; + for (d = option_deprecation_notes_; d->name; ++d) { + printf("%s\n", d->name); + } } /** Last value actually set by resolve_my_address. */ @@ -4703,10 +4712,15 @@ options_init_from_torrc(int argc, char **argv) exit(0); } if (config_line_find(cmdline_only_options, "--list-torrc-options")) { - /* For documenting validating whether we've documented everything. */ + /* For validating whether we've documented everything. */ list_torrc_options(); exit(0); } + if (config_line_find(cmdline_only_options, "--list-deprecated-options")) { + /* For validating whether what we have deprecated really exists. */ + list_deprecated_options(); + exit(0); + } if (config_line_find(cmdline_only_options, "--version")) { printf("Tor version %s.\n",get_version()); |