[Pkg-gnupg-commit] [gnupg2] 46/185: gpg: Support 'gpgcompose --encrypted-pop --help'

Daniel Kahn Gillmor dkg at fifthhorseman.net
Mon Aug 7 11:55:19 UTC 2017


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch experimental
in repository gnupg2.

commit 4ddf4e114c8df06d89144e857b7601de0b7e5a7c
Author: Neal H. Walfield <neal at g10code.com>
Date:   Sun Jun 11 14:00:22 2017 +0200

    gpg: Support 'gpgcompose --encrypted-pop --help'
    
    * g10/gpgcompose.c (encrypted_pop_options): New variable.
    (encrypted_pop): Support the --help option.
    
    Reported-by: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
---
 g10/gpgcompose.c | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/g10/gpgcompose.c b/g10/gpgcompose.c
index a8da54c..49bb8af 100644
--- a/g10/gpgcompose.c
+++ b/g10/gpgcompose.c
@@ -2580,18 +2580,36 @@ encrypted (const char *option, int argc, char *argv[], void *cookie)
   return processed;
 }
 

+static struct option encrypted_pop_options[] = {
+  { NULL, NULL,
+    "Example:\n\n"
+    "  $ gpgcompose --sk-esk PASSWORD \\\n"
+    "    --encrypted-mdc \\\n"
+    "      --literal --value foo \\\n"
+    "    --encrypted-pop | " GPG_NAME " --list-packets" }
+};
+
 static int
 encrypted_pop (const char *option, int argc, char *argv[], void *cookie)
 {
   iobuf_t out = cookie;
+  int processed;
 
-  (void) argc;
-  (void) argv;
+  processed = process_options (option,
+                               major_options,
+                               encrypted_pop_options,
+                               NULL,
+                               global_options, NULL,
+                               argc, argv);
+  /* We only support a single option, --help, which causes the program
+   * to exit.  */
+  log_assert (processed == 0);
 
+  filter_pop (out, PKT_ENCRYPTED);
 
   debug ("Popped encryption container.\n");
 
-  return 0;
+  return processed;
 }
 

 struct data

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list