Give Usage when called with no arguments
[pgp-tools.git] / gpglist / gpglist
index 58d5c1e691e0565b2d31c7bd28a0b91cf1a6f638..42b4dcea3d00abc04cb9d5cc6cd7dac80f461e6a 100755 (executable)
@@ -1,5 +1,7 @@
 #!/usr/bin/perl
 
+# $Id$
+
 # small script to show in an intuitive way who signed which of your user ids
 #
 # Copyright (c) 2004 Uli Martens <uli@youam.net>
 
 use strict;
 use warnings;
+use English;
 
 my $key=shift @ARGV;
-if ( $key eq "" ) {
-       die
+unless (defined $key) {
+       die "Usage: $PROGRAM_NAME <keyid>\n";
 }
 
 open SIGS, "gpg --fixed-list-mode --with-colons --list-sigs $key 2>/dev/null |"
@@ -78,6 +81,10 @@ while (<SIGS>) {
 }
 close SIGS;
 
+# XXX: Add an option for this
+my $c = 0;
+@uids = grep { ! defined $rev{$uids[$c++]} } @uids;
+
 my $n = scalar @uids -1;
 for ( my $a=0; $a <= $n; $a++ ) {
        printf "|  " x ($a)