mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
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.
This commit is contained in:
parent
26ec6c7902
commit
de01c51ecb
11 changed files with 98 additions and 3 deletions
11
g13/g13.c
11
g13/g13.c
|
@ -599,6 +599,17 @@ main ( int argc, char **argv)
|
|||
if (may_coredump && !opt.quiet)
|
||||
log_info (_("WARNING: program may create a core file!\n"));
|
||||
|
||||
/* 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 (logfile)
|
||||
{
|
||||
log_set_file (logfile);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue