mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-23 21:59:57 +01:00
* gpgkeys_ldap.c (main, show_help): Kludge to implement standard
GNU options. Factored help printing out. * gpgkeys_finger.c (main, show_help): Ditto. * gpgkeys_hkp.c (main, show_help): Ditto. * gpgkeys_http.c (main, show_help): Ditto. * gpgkeys_test.in, gpgkeys_mailto.in: Implement --version and --help.
This commit is contained in:
parent
c12b9b1f64
commit
e170c54cf8
@ -1,5 +1,12 @@
|
||||
2004-10-15 Werner Koch <wk@g10code.com>
|
||||
|
||||
* gpgkeys_ldap.c (main, show_help): Kludge to implement standard
|
||||
GNU options. Factored help printing out.
|
||||
* gpgkeys_finger.c (main, show_help): Ditto.
|
||||
* gpgkeys_hkp.c (main, show_help): Ditto.
|
||||
* gpgkeys_http.c (main, show_help): Ditto.
|
||||
* gpgkeys_test.in, gpgkeys_mailto.in: Implement --version and --help.
|
||||
|
||||
* Makefile.am: Add ksutil.h.
|
||||
|
||||
2004-10-14 David Shaw <dshaw@jabberwocky.com>
|
||||
|
@ -357,6 +357,14 @@ get_key (char *getkey)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
show_help (FILE *fp)
|
||||
{
|
||||
fprintf (fp,"-h\thelp\n");
|
||||
fprintf (fp,"-V\tversion\n");
|
||||
fprintf (fp,"-o\toutput to this file\n");
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc,char *argv[])
|
||||
{
|
||||
@ -367,14 +375,24 @@ main(int argc,char *argv[])
|
||||
|
||||
console=stderr;
|
||||
|
||||
/* Kludge to implement standard GNU options. */
|
||||
if (argc > 1 && !strcmp (argv[1], "--version"))
|
||||
{
|
||||
fputs ("gpgkeys_ldap (GnuPG) " VERSION"\n", stdout);
|
||||
return 0;
|
||||
}
|
||||
else if (argc > 1 && !strcmp (argv[1], "--help"))
|
||||
{
|
||||
show_help (stdout);
|
||||
return 0;
|
||||
}
|
||||
|
||||
while((arg=getopt(argc,argv,"hVo:"))!=-1)
|
||||
switch(arg)
|
||||
{
|
||||
default:
|
||||
case 'h':
|
||||
fprintf(console,"-h\thelp\n");
|
||||
fprintf(console,"-V\tversion\n");
|
||||
fprintf(console,"-o\toutput to this file\n");
|
||||
show_help (console);
|
||||
return KEYSERVER_OK;
|
||||
|
||||
case 'V':
|
||||
|
@ -755,6 +755,14 @@ fail_all(struct keylist *keylist,int action,int err)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
show_help (FILE *fp)
|
||||
{
|
||||
fprintf (fp,"-h\thelp\n");
|
||||
fprintf (fp,"-V\tversion\n");
|
||||
fprintf (fp,"-o\toutput to this file\n");
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc,char *argv[])
|
||||
{
|
||||
@ -766,14 +774,24 @@ main(int argc,char *argv[])
|
||||
|
||||
console=stderr;
|
||||
|
||||
/* Kludge to implement standard GNU options. */
|
||||
if (argc > 1 && !strcmp (argv[1], "--version"))
|
||||
{
|
||||
fputs ("gpgkeys_ldap (GnuPG) " VERSION"\n", stdout);
|
||||
return 0;
|
||||
}
|
||||
else if (argc > 1 && !strcmp (argv[1], "--help"))
|
||||
{
|
||||
show_help (stdout);
|
||||
return 0;
|
||||
}
|
||||
|
||||
while((arg=getopt(argc,argv,"hVo:"))!=-1)
|
||||
switch(arg)
|
||||
{
|
||||
default:
|
||||
case 'h':
|
||||
fprintf(console,"-h\thelp\n");
|
||||
fprintf(console,"-V\tversion\n");
|
||||
fprintf(console,"-o\toutput to this file\n");
|
||||
show_help (console);
|
||||
return KEYSERVER_OK;
|
||||
|
||||
case 'V':
|
||||
|
@ -123,6 +123,14 @@ get_key(char *getkey)
|
||||
return KEYSERVER_OK;
|
||||
}
|
||||
|
||||
static void
|
||||
show_help (FILE *fp)
|
||||
{
|
||||
fprintf (fp,"-h\thelp\n");
|
||||
fprintf (fp,"-V\tversion\n");
|
||||
fprintf (fp,"-o\toutput to this file\n");
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc,char *argv[])
|
||||
{
|
||||
@ -133,14 +141,24 @@ main(int argc,char *argv[])
|
||||
|
||||
console=stderr;
|
||||
|
||||
/* Kludge to implement standard GNU options. */
|
||||
if (argc > 1 && !strcmp (argv[1], "--version"))
|
||||
{
|
||||
fputs ("gpgkeys_http (GnuPG) " VERSION"\n", stdout);
|
||||
return 0;
|
||||
}
|
||||
else if (argc > 1 && !strcmp (argv[1], "--help"))
|
||||
{
|
||||
show_help (stdout);
|
||||
return 0;
|
||||
}
|
||||
|
||||
while((arg=getopt(argc,argv,"hVo:"))!=-1)
|
||||
switch(arg)
|
||||
{
|
||||
default:
|
||||
case 'h':
|
||||
fprintf(console,"-h\thelp\n");
|
||||
fprintf(console,"-V\tversion\n");
|
||||
fprintf(console,"-o\toutput to this file\n");
|
||||
show_help (console);
|
||||
return KEYSERVER_OK;
|
||||
|
||||
case 'V':
|
||||
|
@ -1532,6 +1532,14 @@ find_basekeyspacedn(void)
|
||||
return LDAP_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
show_help (FILE *fp)
|
||||
{
|
||||
fprintf (fp,"-h\thelp\n");
|
||||
fprintf (fp,"-V\tversion\n");
|
||||
fprintf (fp,"-o\toutput to this file\n");
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc,char *argv[])
|
||||
{
|
||||
@ -1543,14 +1551,24 @@ main(int argc,char *argv[])
|
||||
|
||||
console=stderr;
|
||||
|
||||
/* Kludge to implement standard GNU options. */
|
||||
if (argc > 1 && !strcmp (argv[1], "--version"))
|
||||
{
|
||||
fputs ("gpgkeys_ldap (GnuPG) " VERSION"\n", stdout);
|
||||
return 0;
|
||||
}
|
||||
else if (argc > 1 && !strcmp (argv[1], "--help"))
|
||||
{
|
||||
show_help (stdout);
|
||||
return 0;
|
||||
}
|
||||
|
||||
while((arg=getopt(argc,argv,"hVo:"))!=-1)
|
||||
switch(arg)
|
||||
{
|
||||
default:
|
||||
case 'h':
|
||||
fprintf(console,"-h\thelp\n");
|
||||
fprintf(console,"-V\tversion\n");
|
||||
fprintf(console,"-o\toutput to this file\n");
|
||||
show_help (console);
|
||||
return KEYSERVER_OK;
|
||||
|
||||
case 'V':
|
||||
@ -1569,6 +1587,7 @@ main(int argc,char *argv[])
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if(argc>optind)
|
||||
{
|
||||
input=fopen(argv[optind],"r");
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!@PERL@ -w
|
||||
|
||||
# gpgkeys_mailto - talk to a email keyserver
|
||||
# gpgkeys_mailto - talk to a email keyserver
|
||||
# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of GnuPG.
|
||||
@ -20,10 +20,28 @@
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
|
||||
use Getopt::Std;
|
||||
$Getopt::Std::STANDARD_HELP_VERSION=1;
|
||||
$sendmail="@SENDMAIL@ -t";
|
||||
|
||||
###
|
||||
|
||||
sub VERSION_MESSAGE ()
|
||||
{
|
||||
print STDOUT "gpgkeys_mailto (GnuPG) 1.3.91-cvs\n";
|
||||
}
|
||||
|
||||
sub HELP_MESSAGE ()
|
||||
{
|
||||
print STDOUT <<EOT
|
||||
|
||||
--help Print this help
|
||||
--version Print the version
|
||||
-o FILE Write output to FILE
|
||||
EOT
|
||||
}
|
||||
|
||||
|
||||
|
||||
getopts('o:');
|
||||
|
||||
if(defined($opt_o))
|
||||
@ -200,3 +218,8 @@ if($command=~/send/i)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Local Variables:
|
||||
# mode:perl
|
||||
# End:
|
||||
|
@ -20,13 +20,29 @@
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
|
||||
use Getopt::Std;
|
||||
$Getopt::Std::STANDARD_HELP_VERSION=1;
|
||||
|
||||
$|=1;
|
||||
|
||||
print STDERR "gpgkeys_test starting\n";
|
||||
sub VERSION_MESSAGE ()
|
||||
{
|
||||
print STDOUT "gpgkeys_test (GnuPG) 1.3.91-cvs\n";
|
||||
}
|
||||
|
||||
sub HELP_MESSAGE ()
|
||||
{
|
||||
print STDOUT <<EOT
|
||||
|
||||
--help Print this help
|
||||
--version Print the version
|
||||
EOT
|
||||
}
|
||||
|
||||
|
||||
getopts('o:');
|
||||
|
||||
print STDERR "gpgkeys_test starting\n";
|
||||
|
||||
if(defined($opt_o))
|
||||
{
|
||||
print STDERR "Using output file $opt_o\n";
|
||||
@ -77,3 +93,7 @@ if($command eq "SEND")
|
||||
}
|
||||
|
||||
printf STDERR "gpgkeys_test finished\n";
|
||||
|
||||
# Local Variables:
|
||||
# mode:perl
|
||||
# End:
|
||||
|
Loading…
x
Reference in New Issue
Block a user