diff options
author | Werner Koch <[email protected]> | 2021-11-14 17:06:33 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2021-11-14 17:09:22 +0000 |
commit | a43efc9294d158c62a3a04396fa3fe6c77090ba8 (patch) | |
tree | b3f633bab40f18fdaac3bb1fafb8acbca74fc75d | |
parent | Update release signing keys (diff) | |
download | gnupg-a43efc9294d158c62a3a04396fa3fe6c77090ba8.tar.gz gnupg-a43efc9294d158c62a3a04396fa3fe6c77090ba8.zip |
agent: Print the non-option warning earlier.
* agent/gpg-agent.c (main): Move detection up.
--
The problem is that PARGS is re-used and when detecting a possible
incorrect use, the flag that "--" has already been seen has gone.
-rw-r--r-- | agent/gpg-agent.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index c7479144d..b126174b7 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -1293,7 +1293,18 @@ main (int argc, char **argv ) break; } } - gnupg_argparse (NULL, &pargs, NULL); /* Release internal state. */ + + /* 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]); + } + + gpgrt_argparse (NULL, &pargs, NULL); /* Release internal state. */ if (!last_configname) config_filename = make_filename (gnupg_homedir (), @@ -1310,15 +1321,6 @@ main (int argc, char **argv ) finalize_rereadable_options (); - /* 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]); - } #ifdef ENABLE_NLS /* gpg-agent usually does not output any messages because it runs in |