1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02: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:
Werner Koch 2004-10-15 12:19:06 +00:00
parent c12b9b1f64
commit e170c54cf8
7 changed files with 137 additions and 14 deletions

View file

@ -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':