From de01c51ecb3918f427aa76281351749c8ad07ed6 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 27 Mar 2012 12:35:13 +0200 Subject: 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. --- dirmngr/dirmngr.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'dirmngr') diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c index ee857189f..9425cd16e 100644 --- a/dirmngr/dirmngr.c +++ b/dirmngr/dirmngr.c @@ -847,6 +847,16 @@ main (int argc, char **argv) log_info ("NOTE: this is a development version!\n"); #endif + /* Print a warning if an argument looks like an option. */ + if (!opt.quiet && !(pargs.flags & ARGPARSE_FLAG_STOP_SEEN)) + { + int i; + + for (i=0; i < argc; i++) + if (argv[i][0] == '-' && argv[i][1] == '-') + log_info (_("NOTE: `%s' is not considered an option\n"), argv[i]); + } + if (!access ("/etc/dirmngr", F_OK) && !strncmp (opt.homedir, "/etc/", 5)) log_info ("NOTE: DirMngr is now a proper part of GnuPG. The configuration and" -- cgit v1.2.3