From d5a28cfb9ed9ff356e218782fe72947960ad04f1 Mon Sep 17 00:00:00 2001 From: weasel Date: Mon, 20 Jun 2005 08:46:49 +0000 Subject: [PATCH] * Help and version go to stdout when a user asks for them explictly * Document multiple key usage properly in synopsis * Extend my copyright statement * Version is now the svn revision * Enable Id, Rev keywords * Set it executable git-svn-id: svn://svn.debian.org/pgp-tools/trunk@71 b513b33f-fedd-0310-b452-c3deb5f4c849 --- gpgsigs/gpgsigs | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) mode change 100644 => 100755 gpgsigs/gpgsigs diff --git a/gpgsigs/gpgsigs b/gpgsigs/gpgsigs old mode 100644 new mode 100755 index a93676d..1033f40 --- a/gpgsigs/gpgsigs +++ b/gpgsigs/gpgsigs @@ -1,5 +1,7 @@ #!/usr/bin/perl +# $Id$ + # See the pod documentation at the end of this file for author, # copyright, and licence information. # @@ -16,7 +18,7 @@ # * better charset conversion # * pod documentation -my $VERSION = "0.2"; +my $VERSION = '$Rev$'; use strict; use warnings; @@ -25,20 +27,24 @@ use IPC::Open3; use Getopt::Long; -sub version +sub version($) { - print STDERR < - (c) 2004 Peter Palfrader + (c) 2004, 2005 Peter Palfrader (c) 2004, 2005 Christoph Berg EOF } -sub usage +sub usage($$) { - version(); - print STDERR <] [] @@ -48,7 +54,7 @@ separate multiple keyids with ',' -f convert from charset -t convert UIDs to charset in output EOF - exit shift; + exit $error; } @@ -57,9 +63,9 @@ GetOptions( f => \$fromcharset, t => \$charset, r => \$recv_keys, - help => sub { usage(0); }, - version => sub { version(); exit 0;}, -) or usage(1); + help => sub { usage(*STDOUT, 0); }, + version => sub { version(*STDOUT); exit 0;}, +) or usage(*STDERR, 1); # charset conversion @@ -127,18 +133,18 @@ sub myrecode($) { # parse options my $mykey = uc(shift @ARGV); -my $keytxt = (shift @ARGV) || usage(1); +my $keytxt = (shift @ARGV) || usage(*STDERR, 1); my $outfile = (shift @ARGV) || '-'; my @mykeys = split /,/, $mykey; map { s/^0x//i; } @mykeys; if (!@mykeys || scalar @ARGV) { - usage(1); + usage(*STDERR, 1); } if (!grep { /^([0-9A-F]{16,16}|[0-9A-F]{8,8})$/ } @mykeys) { print STDERR "Invalid keyid given\n"; - usage(1); + usage(*STDERR, 1); } -r $keytxt or die ("$keytxt does not exist\n"); @@ -273,7 +279,7 @@ B - annotate list of GnuPG keys with already done signatures =head1 SYNOPSIS -B [-r] [-f I] [-t I] I F [F] +B [-r] [-f I] [-t I] II<[>B<,>IB<,>I<...>I<]>>I<]> F [F] =head1 DESCRIPTION @@ -303,7 +309,7 @@ LANG, and if all these are unset, the default is ISO-8859-1. =item I Use this keyid (8 or 16 byte) for annotation. Multiple keyids can be separated -by I<,>. +by a comma (B<,>). =item F @@ -338,7 +344,7 @@ http://pgp-tools.alioth.debian.org/ (c) 2004 Uli Martens -(c) 2004 Peter Palfrader +(c) 2004, 2005 Peter Palfrader (c) 2004, 2005 Christoph Berg -- 2.39.5