chiark / gitweb /
Import gnupg2_2.1.18-8~deb9u1.debian.tar.bz2
[gnupg2.git] / patches / 0031-gpg-Fix-aliases-list-key-list-sig-and-check-sig.patch
1 From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2 Date: Sat, 4 Feb 2017 01:23:32 -0500
3 Subject: gpg: Fix aliases --list-key, --list-sig, and --check-sig.
4
5 * g10/gpg.c (opts): Define commands with ARGPARSE_c
6 instead of ARGPARSE_s_n.
7
8 --
9
10 These three entries are commands, but they're being treated as a
11 string-based option for some reason.  However, if you try to use them
12 concurrently with another command like --clearsign, you'll get "gpg:
13 conflicting commands".
14
15 Furthermore, because they're marked as options, their flags differ
16 from the commands that they alias, they cause ambiguity in
17 abbreviation (e.g. try "gpg --list-ke") which should have been fixed
18 by 7249ab0f95d1f6cb8ee61eefedc79801bb56398f.
19
20 Marking them explicitly as commands for argparse should be more
21 accurate and should resolve the abbreviation ambiguity issue.
22
23 Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
24 gpg: fix aliases --list-key, --list-sig, and --check-sig.
25
26 * g10/gpg.c: ARGPARSE_OPTS opts[]: define commands with ARGPARSE_c
27 instead of ARGPARSE_s_n.
28
29 --
30
31 These three entries are commands, but they're being treated as a
32 string-based option for some reason.  However, if you try to use them
33 concurrently with another command like --clearsign, you'll get "gpg:
34 conflicting commands".
35
36 Furthermore, because they're marked as options, their flags differ
37 from the commands that they alias, they cause ambiguity in
38 abbreviation (e.g. try "gpg --list-ke") which should have been fixed
39 by 7249ab0f95d1f6cb8ee61eefedc79801bb56398f.
40
41 Marking them explicitly as commands for argparse should be more
42 accurate and should resolve the abbreviation ambiguity issue.
43
44 Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
45 (cherry picked from commit f31120a5aa40b6e4e89d41d1d5d34e0f7da173b4)
46 ---
47  g10/gpg.c | 6 +++---
48  1 file changed, 3 insertions(+), 3 deletions(-)
49
50 diff --git a/g10/gpg.c b/g10/gpg.c
51 index f9039ae..e280c22 100644
52 --- a/g10/gpg.c
53 +++ b/g10/gpg.c
54 @@ -728,9 +728,9 @@ static ARGPARSE_OPTS opts[] = {
55    ARGPARSE_s_n (oWithKeyData,"with-key-data", "@"),
56    ARGPARSE_s_n (oWithSigList,"with-sig-list", "@"),
57    ARGPARSE_s_n (oWithSigCheck,"with-sig-check", "@"),
58 -  ARGPARSE_s_n (aListKeys, "list-key", "@"),   /* alias */
59 -  ARGPARSE_s_n (aListSigs, "list-sig", "@"),   /* alias */
60 -  ARGPARSE_s_n (aCheckKeys, "check-sig", "@"), /* alias */
61 +  ARGPARSE_c (aListKeys, "list-key", "@"),   /* alias */
62 +  ARGPARSE_c (aListSigs, "list-sig", "@"),   /* alias */
63 +  ARGPARSE_c (aCheckKeys, "check-sig", "@"), /* alias */
64    ARGPARSE_s_n (oSkipVerify, "skip-verify", "@"),
65    ARGPARSE_s_n (oSkipHiddenRecipients, "skip-hidden-recipients", "@"),
66    ARGPARSE_s_n (oNoSkipHiddenRecipients, "no-skip-hidden-recipients", "@"),