summaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-05-09 11:26:13 -0400
committerNick Mathewson <nickm@torproject.org>2019-05-14 19:19:53 -0400
commit1b16fcb70cb9507184fe7316396c93c1daa12674 (patch)
tree5e44a6d5e30225466b19c25b1665a088c4373c37 /src/app
parent231036a110c1062e39b214b4b88fdc2a1eb46dc8 (diff)
downloadtor-1b16fcb70cb9507184fe7316396c93c1daa12674.tar.gz
tor-1b16fcb70cb9507184fe7316396c93c1daa12674.zip
Add a --list-modules command
Closes ticket 30452.
Diffstat (limited to 'src/app')
-rw-r--r--src/app/config/config.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c
index 2a504d3065..7ccd76e7f0 100644
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@ -2474,6 +2474,7 @@ static const struct {
{ "--quiet", TAKES_NO_ARGUMENT },
{ "--hush", TAKES_NO_ARGUMENT },
{ "--version", TAKES_NO_ARGUMENT },
+ { "--list-modules", TAKES_NO_ARGUMENT },
{ "--library-versions", TAKES_NO_ARGUMENT },
{ "-h", TAKES_NO_ARGUMENT },
{ "--help", TAKES_NO_ARGUMENT },
@@ -2695,6 +2696,13 @@ list_deprecated_options(void)
}
}
+/** Print all compile-time modules and their enabled/disabled status. */
+static void
+list_enabled_modules(void)
+{
+ printf("%s: %s\n", "dirauth", have_module_dirauth() ? "yes" : "no");
+}
+
/** Last value actually set by resolve_my_address. */
static uint32_t last_resolved_addr = 0;
@@ -5198,6 +5206,11 @@ options_init_from_torrc(int argc, char **argv)
return 1;
}
+ if (config_line_find(cmdline_only_options, "--list-modules")) {
+ list_enabled_modules();
+ return 1;
+ }
+
if (config_line_find(cmdline_only_options, "--library-versions")) {
printf("Tor version %s. \n", get_version());
printf("Library versions\tCompiled\t\tRuntime\n");