[Pkg-gnupg-commit] [gnupg2] 126/180: g10: Rework the --quick-* interface.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Sat Dec 24 22:29:18 UTC 2016


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

dkg pushed a commit to branch master
in repository gnupg2.

commit 41ad04d403de05abe54280d2a84aa51a603194e4
Author: Justus Winter <justus at g10code.com>
Date:   Thu Dec 15 15:32:51 2016 +0100

    g10: Rework the --quick-* interface.
    
    * g10/gpg.c (opts): Rename options.
    (main): Update errors.
    * doc/gpg.texi: Update accordingly.
    --
    I decided not to keep the old versions as aliases in the documentation
    because the interface is a fairly recent addition.
    
    GnuPG-bug-id: 2700
    Signed-off-by: Justus Winter <justus at g10code.com>
---
 doc/gpg.texi                             | 18 +++++++++---------
 g10/gpg.c                                | 18 +++++++++++-------
 tests/openpgp/quick-key-manipulation.scm |  8 ++++----
 3 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/doc/gpg.texi b/doc/gpg.texi
index 81588e1..ab0289d 100644
--- a/doc/gpg.texi
+++ b/doc/gpg.texi
@@ -618,8 +618,8 @@ This section explains the main commands for key management.
 
 @table @gnupgtabopt
 
- at item --quick-gen-key @code{user-id} [@code{algo} [@code{usage} [@code{expire}]]]
- at opindex quick-gen-key
+ at item --quick-generate-key @code{user-id} [@code{algo} [@code{usage} [@code{expire}]]]
+ at opindex quick-generate-key
 This is a simple command to generate a standard key with one user id.
 In contrast to @option{--generate-key} the key is generated directly
 without the need to answer a bunch of prompts.  Unless the option
@@ -636,7 +636,7 @@ created and no prompts are shown.  To specify an expiration date but
 still create a primary and subkey use ``default'' or
 ``future-default'' for @code{algo} and ``default'' for @code{usage}.
 For a description of these optional arguments see the command
- at code{--quick-addkey}.  The @code{usage} accepts also the value
+ at code{--quick-add-key}.  The @code{usage} accepts also the value
 ``cert'' which can be used to create a certification only primary key;
 the default is to a create certification and signing key.
 
@@ -660,8 +660,8 @@ Directly set the expiration time of the primary key to @code{expire}.
 To remove the expiration time @code{0} can be used.
 
 
- at item --quick-addkey @code{fpr} [@code{algo} [@code{usage} [@code{expire}]]]
- at opindex quick-addkey
+ at item --quick-add-key @code{fpr} [@code{algo} [@code{usage} [@code{expire}]]]
+ at opindex quick-add-key
 Directly add a subkey to the key identified by the fingerprint
 @code{fpr}.  Without the optional arguments an encryption subkey is
 added.  If any of the arguments are given a more specific subkey is
@@ -1074,16 +1074,16 @@ full flexibility of the "sign" subcommand from @option{--edit-key}.
 Its intended use is to help unattended key signing by utilizing a list
 of verified fingerprints.
 
- at item --quick-adduid  @var{user-id} @var{new-user-id}
- at opindex quick-adduid
+ at item --quick-add-uid  @var{user-id} @var{new-user-id}
+ at opindex quick-add-uid
 This command adds a new user id to an existing key.  In contrast to
 the interactive sub-command @code{adduid} of @option{--edit-key} the
 @var{new-user-id} is added verbatim with only leading and trailing
 white space removed, it is expected to be UTF-8 encoded, and no checks
 on its form are applied.
 
- at item --quick-revuid  @var{user-id} @var{user-id-to-revoke}
- at opindex quick-revuid
+ at item --quick-revoke-uid  @var{user-id} @var{user-id-to-revoke}
+ at opindex quick-revoke-uid
 This command revokes a User ID on an existing key.  It cannot be used
 to revoke the last User ID on key (some non-revoked User ID must
 remain), with revocation reason ``User ID is no longer valid''.  If
diff --git a/g10/gpg.c b/g10/gpg.c
index f382a7a..e680748 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -447,13 +447,17 @@ static ARGPARSE_OPTS opts[] = {
   ARGPARSE_c (aKeygen,	    "generate-key",
               N_("generate a new key pair")),
   ARGPARSE_c (aKeygen,	    "gen-key", "@"),
-  ARGPARSE_c (aQuickKeygen, "quick-gen-key" ,
+  ARGPARSE_c (aQuickKeygen, "quick-generate-key" ,
               N_("quickly generate a new key pair")),
-  ARGPARSE_c (aQuickAddUid,  "quick-adduid",
+  ARGPARSE_c (aQuickKeygen, "quick-gen-key", "@"),
+  ARGPARSE_c (aQuickAddUid,  "quick-add-uid",
               N_("quickly add a new user-id")),
+  ARGPARSE_c (aQuickAddUid,  "quick-adduid", "@"),
+  ARGPARSE_c (aQuickAddKey,  "quick-add-key", "@"),
   ARGPARSE_c (aQuickAddKey,  "quick-addkey", "@"),
-  ARGPARSE_c (aQuickRevUid,  "quick-revuid",
+  ARGPARSE_c (aQuickRevUid,  "quick-revoke-uid",
               N_("quickly revoke a user-id")),
+  ARGPARSE_c (aQuickRevUid,  "quick-revuid", "@"),
   ARGPARSE_c (aQuickSetExpire,  "quick-set-expire",
               N_("quickly set a new expiration date")),
   ARGPARSE_c (aFullKeygen,  "full-generate-key" ,
@@ -4299,7 +4303,7 @@ main (int argc, char **argv)
           const char *x_algo, *x_usage, *x_expire;
 
           if (argc < 1 || argc > 4)
-            wrong_args("--quick-gen-key USER-ID [ALGO [USAGE [EXPIRE]]]");
+            wrong_args("--quick-generate-key USER-ID [ALGO [USAGE [EXPIRE]]]");
           username = make_username (fname);
           argv++, argc--;
           x_algo = "";
@@ -4364,7 +4368,7 @@ main (int argc, char **argv)
           const char *uid, *newuid;
 
           if (argc != 2)
-            wrong_args ("--quick-adduid USER-ID NEW-USER-ID");
+            wrong_args ("--quick-add-uid USER-ID NEW-USER-ID");
           uid = *argv++; argc--;
           newuid = *argv++; argc--;
           keyedit_quick_adduid (ctrl, uid, newuid);
@@ -4376,7 +4380,7 @@ main (int argc, char **argv)
           const char *x_fpr, *x_algo, *x_usage, *x_expire;
 
           if (argc < 1 || argc > 4)
-            wrong_args ("--quick-addkey FINGERPRINT [ALGO [USAGE [EXPIRE]]]");
+            wrong_args ("--quick-add-key FINGERPRINT [ALGO [USAGE [EXPIRE]]]");
           x_fpr = *argv++; argc--;
           x_algo = "";
           x_usage = "";
@@ -4402,7 +4406,7 @@ main (int argc, char **argv)
           const char *uid, *uidtorev;
 
           if (argc != 2)
-            wrong_args ("--quick-revuid USER-ID USER-ID-TO-REVOKE");
+            wrong_args ("--quick-revoke-uid USER-ID USER-ID-TO-REVOKE");
           uid = *argv++; argc--;
           uidtorev = *argv++; argc--;
           keyedit_quick_revuid (ctrl, uid, uidtorev);
diff --git a/tests/openpgp/quick-key-manipulation.scm b/tests/openpgp/quick-key-manipulation.scm
index 639fd62..9b9c919 100755
--- a/tests/openpgp/quick-key-manipulation.scm
+++ b/tests/openpgp/quick-key-manipulation.scm
@@ -52,7 +52,7 @@
 (setenv "PINENTRY_USER_DATA" "test" #t)
 
 (info "Checking quick key generation...")
-(call-check `(, at GPG --quick-gen-key ,alpha))
+(call-check `(, at GPG --quick-generate-key ,alpha))
 
 (define keyinfo (gpg-with-colons `(-k ,(exact alpha))))
 (define fpr (:fpr (assoc "fpr" keyinfo)))
@@ -65,7 +65,7 @@
 ;; Make sure the key capabilities don't change when we add a user id.
 ;; (See bug #2697.)
 (let ((pre (key-data (exact alpha)))
-      (result (call-check `(, at GPG --quick-adduid ,(exact alpha) ,bravo)))
+      (result (call-check `(, at GPG --quick-add-uid ,(exact alpha) ,bravo)))
       (post (key-data (exact alpha))))
   (if (not (equal? pre post))
       (begin
@@ -83,7 +83,7 @@
 (assert (= 2 (count-uids-of-secret-key bravo)))
 
 (info "Checking that we can revoke a user ID...")
-(call-check `(, at GPG --quick-revuid ,(exact bravo) ,alpha))
+(call-check `(, at GPG --quick-revoke-uid ,(exact bravo) ,alpha))
 
 (assert (= 1 (count-uids-of-secret-key bravo)))
 
@@ -118,7 +118,7 @@
  "Checking that we can add subkeys..."
  (lambda (args check)
    (set! count (+ 1 count))
-   (call-check `(, at gpg --quick-addkey ,fpr , at args))
+   (call-check `(, at gpg --quick-add-key ,fpr , at args))
    (let ((subkeys (get-subkeys)))
      (assert (= count (length subkeys)))
      (if check (check (last subkeys)))))

-- 
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