summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2022-01-16 07:57:02 +0100
committerDaiki Ueno <ueno@gnu.org>2022-01-17 16:57:21 +0100
commite256951eab4cc44367f8cc7bd2a51eeaacc10f7d (patch)
tree666f64e885bb22dd43a89ed9e583680eb6f8c6ce
parent53bd182ef262be22ad4fc3bcba33a0ca64e7e6c3 (diff)
downloadgnutls-e256951eab4cc44367f8cc7bd2a51eeaacc10f7d.tar.gz
cli: add --list-config option
With this option gnutls-cli prints the build-time configuration of the library, retrieved through gnutls_get_library_config. Signed-off-by: Daiki Ueno <ueno@gnu.org>
-rw-r--r--src/cli.c9
-rw-r--r--src/gnutls-cli-options.json7
2 files changed, 15 insertions, 1 deletions
diff --git a/src/cli.c b/src/cli.c
index 09f7efc2c3..5378b72256 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -1640,6 +1640,15 @@ static void cmd_parser(int argc, char **argv)
exit(1);
}
+ if (HAVE_OPT(LIST_CONFIG)) {
+ const gnutls_library_config_st *p;
+
+ for (p = gnutls_get_library_config(); p->name; p++) {
+ log_msg(stdout, "%s: %s\n", p->name, p->value);
+ }
+ exit(0);
+ }
+
if (HAVE_OPT(BENCHMARK_CIPHERS)) {
benchmark_cipher(OPT_VALUE_DEBUG);
exit(0);
diff --git a/src/gnutls-cli-options.json b/src/gnutls-cli-options.json
index 0777e6b198..bffa18e365 100644
--- a/src/gnutls-cli-options.json
+++ b/src/gnutls-cli-options.json
@@ -387,6 +387,11 @@
"desc": "Reports the status of the FIPS140-2 mode in gnutls library"
},
{
+ "detail": "",
+ "long-option": "list-config",
+ "desc": "Reports the configuration of the library"
+ },
+ {
"desc": "Redirect informational messages to a specific file.",
"arg-type": "string",
"long-option": "logfile",
@@ -418,4 +423,4 @@
}
]
}
-] \ No newline at end of file
+]