gpg: New command --list-gcrypt-config.
authorWerner Koch <wk@gnupg.org>
Wed, 11 Mar 2015 13:58:38 +0000 (14:58 +0100)
committerWerner Koch <wk@gnupg.org>
Wed, 11 Mar 2015 13:59:25 +0000 (14:59 +0100)
* g10/gpg.c (aListGcryptConfig): New.
(main): Implement command.

Signed-off-by: Werner Koch <wk@gnupg.org>
g10/gpg.c

index 576b88e..060495e 100644 (file)
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -109,6 +109,7 @@ enum cmd_and_opt_values
     aSignKey,
     aLSignKey,
     aListConfig,
     aSignKey,
     aLSignKey,
     aListConfig,
+    aListGcryptConfig,
     aGPGConfList,
     aGPGConfTest,
     aListPackets,
     aGPGConfList,
     aGPGConfTest,
     aListPackets,
@@ -431,6 +432,7 @@ static ARGPARSE_OPTS opts[] = {
   ARGPARSE_c (aChangePIN,  "change-pin", N_("change a card's PIN")),
 #endif
   ARGPARSE_c (aListConfig, "list-config", "@"),
   ARGPARSE_c (aChangePIN,  "change-pin", N_("change a card's PIN")),
 #endif
   ARGPARSE_c (aListConfig, "list-config", "@"),
+  ARGPARSE_c (aListGcryptConfig, "list-gcrypt-config", "@"),
   ARGPARSE_c (aGPGConfList, "gpgconf-list", "@" ),
   ARGPARSE_c (aGPGConfTest, "gpgconf-test", "@" ),
   ARGPARSE_c (aListPackets, "list-packets","@"),
   ARGPARSE_c (aGPGConfList, "gpgconf-list", "@" ),
   ARGPARSE_c (aGPGConfTest, "gpgconf-test", "@" ),
   ARGPARSE_c (aListPackets, "list-packets","@"),
@@ -2153,6 +2155,7 @@ main (int argc, char **argv)
          {
          case aCheckKeys:
          case aListConfig:
          {
          case aCheckKeys:
          case aListConfig:
+         case aListGcryptConfig:
           case aGPGConfList:
           case aGPGConfTest:
          case aListPackets:
           case aGPGConfList:
           case aGPGConfTest:
          case aListPackets:
@@ -4064,6 +4067,13 @@ main (int argc, char **argv)
        }
        break;
 
        }
        break;
 
+      case aListGcryptConfig:
+        /* Fixme: It would be nice to integrate that with
+           --list-config but unfortunately there is no way yet to have
+           libgcrypt print it to an estream for further parsing.  */
+        gcry_control (GCRYCTL_PRINT_CONFIG, stdout);
+        break;
+
       case aListPackets:
        opt.list_packets=2;
       default:
       case aListPackets:
        opt.list_packets=2;
       default: