diff options
author | Werner Koch <[email protected]> | 2014-09-25 20:13:03 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2014-09-25 20:14:30 +0000 |
commit | 20c6da50d4f6264d26d113d7de606971f719a0ca (patch) | |
tree | 401d603c403c9aaaef8e3ee00d667ebfcdcc6795 | |
parent | gpg: Warn about (but don't fail) on scdaemon options in gpg.conf. (diff) | |
download | gnupg-20c6da50d4f6264d26d113d7de606971f719a0ca.tar.gz gnupg-20c6da50d4f6264d26d113d7de606971f719a0ca.zip |
gpg: Do not always print dashes in obsolete_option.
* g10/gpg.c (main): Pass option names to obsolete_option without
double dash.
* g10/misc.c (obsolete_option, obsolete_scdaemon_option): Print double
dash only for command line options.
-rw-r--r-- | g10/gpg.c | 25 | ||||
-rw-r--r-- | g10/misc.c | 9 |
2 files changed, 15 insertions, 19 deletions
@@ -531,10 +531,6 @@ static ARGPARSE_OPTS opts[] = { ARGPARSE_s_n (oDryRun, "dry-run", N_("do not make any changes")), ARGPARSE_s_n (oInteractive, "interactive", N_("prompt before overwriting")), - ARGPARSE_s_n (oUseAgent, "use-agent", "@"), - ARGPARSE_s_n (oNoUseAgent, "no-use-agent", "@"), - ARGPARSE_s_s (oGpgAgentInfo, "gpg-agent-info", "@"), - ARGPARSE_s_n (oBatch, "batch", "@"), ARGPARSE_s_n (oAnswerYes, "yes", "@"), ARGPARSE_s_n (oAnswerNo, "no", "@"), @@ -793,6 +789,9 @@ static ARGPARSE_OPTS opts[] = { ARGPARSE_s_n (oNoAutoKeyLocate, "no-auto-key-locate", "@"), /* Dummy options with warnings. */ + ARGPARSE_s_n (oUseAgent, "use-agent", "@"), + ARGPARSE_s_n (oNoUseAgent, "no-use-agent", "@"), + ARGPARSE_s_s (oGpgAgentInfo, "gpg-agent-info", "@"), ARGPARSE_s_s (oReaderPort, "reader-port", "@"), ARGPARSE_s_s (octapiDriver, "ctapi-driver", "@"), ARGPARSE_s_s (opcscDriver, "pcsc-driver", "@"), @@ -2354,28 +2353,24 @@ main (int argc, char **argv) case oUseAgent: /* Dummy. */ break; + case oNoUseAgent: - obsolete_option (configname, configlineno, "--no-use-agent"); + obsolete_option (configname, configlineno, "no-use-agent"); break; case oGpgAgentInfo: - obsolete_option (configname, configlineno, "--gpg-agent-info"); + obsolete_option (configname, configlineno, "gpg-agent-info"); break; - case oReaderPort: - obsolete_scdaemon_option (configname, configlineno, - "--reader-port"); + obsolete_scdaemon_option (configname, configlineno, "reader-port"); break; case octapiDriver: - obsolete_scdaemon_option (configname, configlineno, - "--ctapi-driver"); + obsolete_scdaemon_option (configname, configlineno, "ctapi-driver"); break; case opcscDriver: - obsolete_scdaemon_option (configname, configlineno, - "--pcsc-driver"); + obsolete_scdaemon_option (configname, configlineno, "pcsc-driver"); break; case oDisableCCID: - obsolete_scdaemon_option (configname, configlineno, - "--disable-ccid"); + obsolete_scdaemon_option (configname, configlineno, "disable-ccid"); break; case oAnswerYes: opt.answer_yes = 1; break; diff --git a/g10/misc.c b/g10/misc.c index fa04387fa..76faa49f6 100644 --- a/g10/misc.c +++ b/g10/misc.c @@ -1038,8 +1038,8 @@ obsolete_option (const char *configname, unsigned int configlineno, log_info (_("%s:%u: obsolete option \"%s\" - it has no effect\n"), configname, configlineno, name); else - log_info (_("WARNING: \"%s\" is an obsolete option - it has no effect\n"), - name); + log_info (_("WARNING: \"%s%s\" is an obsolete option - it has no effect\n"), + "--", name); } @@ -1052,8 +1052,9 @@ obsolete_scdaemon_option (const char *configname, unsigned int configlineno, " - it only has effect in %s\n"), configname, configlineno, name, SCDAEMON_NAME EXTSEP_S "conf"); else - log_info (_("WARNING: \"%s\" is an obsolete option" - " - it has no effect except on %s\n"), name, SCDAEMON_NAME); + log_info (_("WARNING: \"%s%s\" is an obsolete option" + " - it has no effect except on %s\n"), + "--", name, SCDAEMON_NAME); } |