]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
cli: add --list-config option
authorDaiki Ueno <ueno@gnu.org>
Sun, 16 Jan 2022 06:57:02 +0000 (07:57 +0100)
committerDaiki Ueno <ueno@gnu.org>
Mon, 17 Jan 2022 15:57:21 +0000 (16:57 +0100)
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>
src/cli.c
src/gnutls-cli-options.json

index 09f7efc2c38fac13012bd5626918fd186fcbadc4..5378b722567898cedef091de80077fa737432e24 100644 (file)
--- 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);
index 0777e6b1988943eae7aac1fcda20b610ee51182c..bffa18e365650851e31749bc2ef035b47b376419 100644 (file)
         "long-option": "fips140-mode",
         "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",
       }
     ]
   }
-]
\ No newline at end of file
+]