aboutsummaryrefslogtreecommitdiffstats
path: root/agent/gpg-agent.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2021-11-14 17:06:33 +0000
committerWerner Koch <[email protected]>2021-11-14 17:06:33 +0000
commitbd5c775878fdfc151a3d996b335ea22d5247c963 (patch)
tree4c7baaec489c5a3c1b617df819998b0ca85b41ad /agent/gpg-agent.c
parentUpdate release signing keys (diff)
downloadgnupg-bd5c775878fdfc151a3d996b335ea22d5247c963.tar.gz
gnupg-bd5c775878fdfc151a3d996b335ea22d5247c963.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.
Diffstat (limited to 'agent/gpg-agent.c')
-rw-r--r--agent/gpg-agent.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index 46fb840bb..2690c0806 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -1321,6 +1321,16 @@ main (int argc, char **argv)
}
}
+ /* 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)
@@ -1345,16 +1355,6 @@ main (int argc, char **argv)
comopt.logfile = NULL;
}
- /* 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
the background. For log files it is acceptable to have messages