Get rid of getopt_long and improve --help output.
authorWerner Koch <wk@gnupg.org>
Tue, 17 Mar 2015 10:28:40 +0000 (11:28 +0100)
committerWerner Koch <wk@gnupg.org>
Tue, 17 Mar 2015 10:28:40 +0000 (11:28 +0100)
commit2f7b275b2b5d31df48f02ab2913ba3ff2e74b7a4
tree3ee37dba60179f8f6594ae0e06e96be78e0f1226
parent8fa3ca90bfbaa84314443fab9865742b78eb85a9
Get rid of getopt_long and improve --help output.

* pinentry/argparse.c, pinentry/argparse.h: New. Taken from GnuPG
master.
* pinentry/Makefile.am (libpinentry_a_SOURCES): Add them.
* pinentry/pinentry.c: Include argparse.h.
(usage): Remove.
(my_strusage): New.
(pinentry_parse_opts): Rewrite.  Do not return a value.  Change call
callers.
--

getopt_long is not generally available, for example it is missing on
AIX.  Instead of adding replacement code we use the option parser
from GnuPG and thus also gain a better --version and --help.

Signed-off-by: Werner Koch <wk@gnupg.org>
12 files changed:
curses/pinentry-curses.c
gtk+-2/pinentry-gtk-2.c
gtk/pinentry-gtk.c
pinentry/Makefile.am
pinentry/argparse.c [new file with mode: 0644]
pinentry/argparse.h [new file with mode: 0644]
pinentry/pinentry.c
pinentry/pinentry.h
qt/main.cpp
qt4/main.cpp
tty/pinentry-tty.c
w32/main.c