aboutsummaryrefslogtreecommitdiffstats
path: root/common/argparse.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2012-03-27 10:35:13 +0000
committerWerner Koch <[email protected]>2012-03-27 10:38:49 +0000
commitde01c51ecb3918f427aa76281351749c8ad07ed6 (patch)
tree944740e90c45a6bea9a0c539b5dab77d0142ec03 /common/argparse.h
parentUpdate the maintenance instructions. (diff)
downloadgnupg-de01c51ecb3918f427aa76281351749c8ad07ed6.tar.gz
gnupg-de01c51ecb3918f427aa76281351749c8ad07ed6.zip
Print warning for arguments not considered an option.
GnuPG requires that options are given before other arguments. This can sometimes be confusing. We now print a warning if we found an argument looking alike a long option without being preceded by the stop option. This is bug#1343. * common/argparse.h (ARGPARSE_FLAG_STOP_SEEN): New. * common/argparse.c (arg_parse): Set new flag. * g10/gpg.c (main): Print the warning. * agent/gpg-agent.c (main): Ditto. * dirmngr/dirmngr.c (main): Ditto. * g13/g13.c (main): Ditto. * scd/scdaemon.c (main): Ditto. * sm/gpgsm.c (main): Ditto. * tools/gpg-connect-agent.c (main): Ditto. * tools/gpgconf.c (main): Ditto.
Diffstat (limited to '')
-rw-r--r--common/argparse.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/argparse.h b/common/argparse.h
index dc9b07b42..c8f4c6019 100644
--- a/common/argparse.h
+++ b/common/argparse.h
@@ -82,6 +82,8 @@ typedef struct
#define ARGPARSE_FLAG_ONEDASH 32 /* Allow long options with one dash. */
#define ARGPARSE_FLAG_NOVERSION 64 /* No output for "--version". */
+#define ARGPARSE_FLAG_STOP_SEEN 256 /* Set to true if a "--" has been seen. */
+
/* Flags for each option (ARGPARSE_OPTS). The type code may be
ORed with the OPT flags. */
#define ARGPARSE_TYPE_NONE 0 /* Does not take an argument. */