diff options
Diffstat (limited to '')
-rw-r--r-- | keyserver/gpgkeys_ldap.c | 25 |
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"); |