aboutsummaryrefslogtreecommitdiffstats
path: root/keyserver/gpgkeys_ldap.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2004-10-15 12:19:06 +0000
committerWerner Koch <[email protected]>2004-10-15 12:19:06 +0000
commite170c54cf836a65423d533d4c47950d9c37d0675 (patch)
tree839f1570673121c07f3fe81c5fb3dc5b9f1d7554 /keyserver/gpgkeys_ldap.c
parent* NEWS: Note gpgkeys_finger, keyserver timeouts, and the direct trust (diff)
downloadgnupg-e170c54cf836a65423d533d4c47950d9c37d0675.tar.gz
gnupg-e170c54cf836a65423d533d4c47950d9c37d0675.zip
* 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.
Diffstat (limited to '')
-rw-r--r--keyserver/gpgkeys_ldap.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/keyserver/gpgkeys_ldap.c b/keyserver/gpgkeys_ldap.c
index 37903a801..97f3911f7 100644
--- a/keyserver/gpgkeys_ldap.c
+++ b/keyserver/gpgkeys_ldap.c
@@ -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");