diff options
author | Werner Koch <wk@gnupg.org> | 2004-10-15 14:19:06 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2004-10-15 14:19:06 +0200 |
commit | e170c54cf836a65423d533d4c47950d9c37d0675 (patch) | |
tree | 839f1570673121c07f3fe81c5fb3dc5b9f1d7554 /keyserver/gpgkeys_http.c | |
parent | * NEWS: Note gpgkeys_finger, keyserver timeouts, and the direct trust (diff) | |
download | gnupg2-e170c54cf836a65423d533d4c47950d9c37d0675.tar.xz gnupg2-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 'keyserver/gpgkeys_http.c')
-rw-r--r-- | keyserver/gpgkeys_http.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/keyserver/gpgkeys_http.c b/keyserver/gpgkeys_http.c index 32700fbc9..6c9768e42 100644 --- a/keyserver/gpgkeys_http.c +++ b/keyserver/gpgkeys_http.c @@ -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': |