diff options
author | Werner Koch <[email protected]> | 2012-03-27 10:35:13 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2012-03-27 10:38:49 +0000 |
commit | de01c51ecb3918f427aa76281351749c8ad07ed6 (patch) | |
tree | 944740e90c45a6bea9a0c539b5dab77d0142ec03 /common/argparse.c | |
parent | Update the maintenance instructions. (diff) | |
download | gnupg-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/common/argparse.c b/common/argparse.c index f55456d41..ce9caff86 100644 --- a/common/argparse.c +++ b/common/argparse.c @@ -229,7 +229,7 @@ initialize( ARGPARSE_ARGS *arg, const char *filename, unsigned *lineno ) arg->err = 0; arg->flags |= 1<<15; /* Mark as initialized. */ if ( *arg->argc < 0 ) - jnlib_log_bug ("invalid argument for arg_parsee\n"); + jnlib_log_bug ("invalid argument for arg_parse\n"); } @@ -671,6 +671,7 @@ arg_parse( ARGPARSE_ARGS *arg, ARGPARSE_OPTS *opts) { /* Stop option processing. */ arg->internal.stopped = 1; + arg->flags |= ARGPARSE_FLAG_STOP_SEEN; argc--; argv++; idx++; goto next_one; } |