[Pgp-tools-commit] r651 - in trunk/keyart: . doc

Guilhem Moulin guilhem-guest at moszumanska.debian.org
Wed Jun 18 13:39:23 UTC 2014


Author: guilhem-guest
Date: 2014-06-18 13:39:23 +0000 (Wed, 18 Jun 2014)
New Revision: 651

Modified:
   trunk/keyart/doc/keyart.1
   trunk/keyart/keyart
Log:
keyart [-f FILE] [KEYID [KEYID ...]]

Each keyring or key file now has to be prefixed with -f.  If no KEYID is
provided, display an ASCII art representation of all keys found in said
keyring or key file.

Modified: trunk/keyart/doc/keyart.1
===================================================================
--- trunk/keyart/doc/keyart.1	2014-06-18 13:39:19 UTC (rev 650)
+++ trunk/keyart/doc/keyart.1	2014-06-18 13:39:23 UTC (rev 651)
@@ -6,13 +6,10 @@
 \- Create ASCII art of an OpenPGP key.
 .SH SYNOPSIS
 .B keyart
-[-a|--ansi] -i|--id KEYID [KEYID ...]
-.br
-.B keyart
-[-a|--ansi] -f|--file FILE [FILE ...]
+[-a|--ansi] [-f|--file \fIFILE\fR] [\fIKEYID\fR ...]
 .SH DESCRIPTION
 .B keyart
-creates an ASCII art representation of a public OpenPGP key. The art is an
+creates an ASCII art representation of public OpenPGP keys. The art is an
 implementation of the Drunken Bishop by Dirk Loss. Documentation about the
 algorithm can be found /usr/share/doc/keyart/, or as appropriate for your
 distribution.
@@ -23,19 +20,20 @@
 the room the drunk bishop has rarely visited, and hot (red) represents squares
 in the room the drunk bishop has frequently visited. There is a 1:1 ratio of
 color to printed character.
-.SH OPTIONS
+
+The \fIKEYID\fRs are key identifiers (fingerprint, keyid, user ID, etc.
+see gpg(1) for details).  If no \fIKEYID\fR is given, \fBkeyart\fR
+creates an ASCII art representation for all keys found.
 .TP 8
 .B -a | --ansi
 Print the ASCII art using ANSI color to the terminal.
 .TP 8
-.B -i | --id KEYID [KEYID ...]
-A key identifier. Can be an email, fingerprint, keyid, name, etc. Either -i or
--k are required.
+.B -f | --file \fIFILE\fR
+An OpenPGP key file or keyring, from which the \fIKEYID\fRs are
+exported.  This option can be repeated multiple times to provide a list
+of key files or keyrings; if this option is not present, the
+\fIKEYID\fRs are exported from GnuPG's default keyring.
 .TP 8
-.B -f | --file FILE [FILE ...]
-A pubicly exported GPG key file. Can be an individual key or a public keyring.
-Either -i or -k are required.
-.TP 8
 .B -h | --help
 Print the help message and quit.
 .SH SEE ALSO

Modified: trunk/keyart/keyart
===================================================================
--- trunk/keyart/keyart	2014-06-18 13:39:19 UTC (rev 650)
+++ trunk/keyart/keyart	2014-06-18 13:39:23 UTC (rev 651)
@@ -9,13 +9,12 @@
 import sys
 
 PARSER = argparse.ArgumentParser(description='Create ASCII art of a PGP key.')
-GROUP = PARSER.add_mutually_exclusive_group(required=True)
 PARSER.add_argument('-a', '--ansi', help='Print the art with ANSI color.',
                     action='store_true')
-GROUP.add_argument('-i', '--id', type=str, nargs='+', metavar=('KEYID'),
-                   help='A key identifier (email, ID, fingerprint, etc.).')
-GROUP.add_argument('-f', '--file', type=str, nargs='+', metavar=('FILE'),
+PARSER.add_argument('-f', '--file', type=str, metavar=('FILE'), action='append',
                    help='A publicly exported GPG key or keyring.')
+PARSER.add_argument('keyid', type=str, nargs='*', metavar=('KEYID'),
+                   help='A key identifier (email, ID, fingerprint, etc.).')
 ARGS = PARSER.parse_args()
 
 def test_env():
@@ -239,9 +238,9 @@
         cmd.append('--no-default-keyring')
         cmd.extend([ '--keyring=%s' % keyring for keyring in ARGS.file ])
 
-    if ARGS.id:
+    if ARGS.keyid:
         cmd.append('--')
-        cmd.extend(ARGS.id)
+        cmd.extend(ARGS.keyid)
 
     gpg = subprocess.Popen(cmd, stdout=subprocess.PIPE)
     for lines in gpg.communicate()[0].split('\n'):




More information about the Pgp-tools-commit mailing list