diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-12-20 17:05:48 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-12-20 17:05:48 +0000 |
commit | e9ad1650c058b582a68a3d3a018e7df47a17746b (patch) | |
tree | fc5fe3a98747dd499d4179976c488eefe09b2d80 /src/or/config.c | |
parent | 00257212c7a9e0e7c2504b7ccdd36727d4fc362f (diff) | |
download | tor-e9ad1650c058b582a68a3d3a018e7df47a17746b.tar.gz tor-e9ad1650c058b582a68a3d3a018e7df47a17746b.zip |
r11651@Kushana: nickm | 2006-12-20 12:05:04 -0500
Add a maintainer script and a new make target "make check-docs" to get a quick dump of which options are undocumented where, and which documentation refers to nonexistent options.
svn:r9160
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c index 7931a9790d..f7a0d26917 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1757,6 +1757,31 @@ print_usage(void) "See man page for options, or http://tor.eff.org/ for documentation.\n"); } +/** Print all non-obsolete torrc options. */ +static void +list_torrc_options(void) +{ + int i; + smartlist_t *lines = smartlist_create(); + for (i = 0; _option_vars[i].name; ++i) { + config_var_t *var = &_option_vars[i]; + const char *desc; + if (var->type == CONFIG_TYPE_OBSOLETE || + var->type == CONFIG_TYPE_LINELIST_V) + continue; + desc = config_find_description(&options_format, var->name); + printf("%s\n", var->name); + if (desc) { + wrap_string(lines, desc, 76, " ", " "); + SMARTLIST_FOREACH(lines, char *, cp, { + printf("%s", cp); + tor_free(cp); + }); + smartlist_clear(lines); + } + } +} + /** Last value actually set by resolve_my_address. */ static uint32_t last_resolved_addr = 0; /** @@ -2928,6 +2953,11 @@ options_init_from_torrc(int argc, char **argv) print_usage(); exit(0); } + if (argc > 1 && !strcmp(argv[1], "--list-torrc-options")) { + /* For documenting validating whether we've documented everything. */ + list_torrc_options(); + exit(0); + } if (argc > 1 && (!strcmp(argv[1],"--version"))) { printf("Tor version %s.\n",VERSION); |