summaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-06-05 16:10:51 -0400
committerNick Mathewson <nickm@torproject.org>2019-06-05 16:10:51 -0400
commita56d7e37aa8f52397f9fd762d07b85f3360afd2a (patch)
treeba5a02b7a50a17698574773630b09b4fc8151a17 /src/app
parent00108b75d4c0f02a7fa5aba240e4b60f79bf4d1d (diff)
parent0c451b31d2694c96ec20145e3b0e9b22cd54819d (diff)
downloadtor-a56d7e37aa8f52397f9fd762d07b85f3360afd2a.tar.gz
tor-a56d7e37aa8f52397f9fd762d07b85f3360afd2a.zip
Merge remote-tracking branch 'tor-github/pr/1020' into maint-0.4.0
Diffstat (limited to 'src/app')
-rw-r--r--src/app/config/config.c13
-rw-r--r--src/app/main/main.c1
2 files changed, 14 insertions, 0 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c
index dc213ce2fc..0d5cc33956 100644
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@ -2444,6 +2444,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 },
@@ -2665,6 +2666,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;
@@ -5176,6 +5184,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");
diff --git a/src/app/main/main.c b/src/app/main/main.c
index 0ffc27d456..4b60763f75 100644
--- a/src/app/main/main.c
+++ b/src/app/main/main.c
@@ -579,6 +579,7 @@ tor_init(int argc, char *argv[])
if (!strcmp(cl->key, "--version") || !strcmp(cl->key, "--digests") ||
!strcmp(cl->key, "--list-torrc-options") ||
!strcmp(cl->key, "--library-versions") ||
+ !strcmp(cl->key, "--list-modules") ||
!strcmp(cl->key, "--hash-password") ||
!strcmp(cl->key, "-h") || !strcmp(cl->key, "--help")) {
if (quiet < 1)