aboutsummaryrefslogtreecommitdiffstats
path: root/keyserver/gpgkeys_hkp.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyserver/gpgkeys_hkp.c')
-rw-r--r--keyserver/gpgkeys_hkp.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/keyserver/gpgkeys_hkp.c b/keyserver/gpgkeys_hkp.c
index 77bad489d..8d180a4f8 100644
--- a/keyserver/gpgkeys_hkp.c
+++ b/keyserver/gpgkeys_hkp.c
@@ -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':