[PATCH] handle disambiguation of --throw-keyids more cleanly

Daniel Kahn Gillmor dkg at fifthhorseman.net
Fri Nov 21 23:25:51 CET 2014


Having both "throw-keyid" and "throw-keyids" as long-opts for the same
value (oThrowKeyids) means that the long-opt disambiguation code in
common/argparse.c fails to figure out what to do with an argument
--throw-key, despite it being an unambiguous prefix to oThrowKeyids.

Dropping the shorter version shouldn't change any behavior currently
in use, since --throw-keyid should be treated as an unambiguous prefix
to --throw-keyids, and is now more consistent with other argument
disambiguation handling.

(this patch does the same for --no-throw-keyid and --no-throw-keyids)
---
 g10/gpg.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/g10/gpg.c b/g10/gpg.c
index a2225a0..08bcd45 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -586,9 +586,7 @@ static ARGPARSE_OPTS opts[] = {
   ARGPARSE_s_s (oCertDigestAlgo, "cert-digest-algo", "@"),
   ARGPARSE_s_s (oCompressAlgo,"compress-algo", "@"),
   ARGPARSE_s_s (oCompressAlgo, "compression-algo", "@"), /* Alias */
-  ARGPARSE_s_n (oThrowKeyids, "throw-keyid", "@"),
   ARGPARSE_s_n (oThrowKeyids, "throw-keyids", "@"),
-  ARGPARSE_s_n (oNoThrowKeyids, "no-throw-keyid", "@"),
   ARGPARSE_s_n (oNoThrowKeyids, "no-throw-keyids", "@"),
   ARGPARSE_s_n (oShowPhotos,   "show-photos", "@"),
   ARGPARSE_s_n (oNoShowPhotos, "no-show-photos", "@"),
-- 
2.1.3




More information about the Gnupg-devel mailing list