1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-23 15:07:03 +01:00

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.
This commit is contained in:
Werner Koch 2014-09-25 22:13:03 +02:00
parent 371c2b14b0
commit 20c6da50d4
2 changed files with 15 additions and 19 deletions

View File

@ -531,10 +531,6 @@ static ARGPARSE_OPTS opts[] = {
ARGPARSE_s_n (oDryRun, "dry-run", N_("do not make any changes")), ARGPARSE_s_n (oDryRun, "dry-run", N_("do not make any changes")),
ARGPARSE_s_n (oInteractive, "interactive", N_("prompt before overwriting")), 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 (oBatch, "batch", "@"),
ARGPARSE_s_n (oAnswerYes, "yes", "@"), ARGPARSE_s_n (oAnswerYes, "yes", "@"),
ARGPARSE_s_n (oAnswerNo, "no", "@"), ARGPARSE_s_n (oAnswerNo, "no", "@"),
@ -793,6 +789,9 @@ static ARGPARSE_OPTS opts[] = {
ARGPARSE_s_n (oNoAutoKeyLocate, "no-auto-key-locate", "@"), ARGPARSE_s_n (oNoAutoKeyLocate, "no-auto-key-locate", "@"),
/* Dummy options with warnings. */ /* 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 (oReaderPort, "reader-port", "@"),
ARGPARSE_s_s (octapiDriver, "ctapi-driver", "@"), ARGPARSE_s_s (octapiDriver, "ctapi-driver", "@"),
ARGPARSE_s_s (opcscDriver, "pcsc-driver", "@"), ARGPARSE_s_s (opcscDriver, "pcsc-driver", "@"),
@ -2354,28 +2353,24 @@ main (int argc, char **argv)
case oUseAgent: /* Dummy. */ case oUseAgent: /* Dummy. */
break; break;
case oNoUseAgent: case oNoUseAgent:
obsolete_option (configname, configlineno, "--no-use-agent"); obsolete_option (configname, configlineno, "no-use-agent");
break; break;
case oGpgAgentInfo: case oGpgAgentInfo:
obsolete_option (configname, configlineno, "--gpg-agent-info"); obsolete_option (configname, configlineno, "gpg-agent-info");
break; break;
case oReaderPort: case oReaderPort:
obsolete_scdaemon_option (configname, configlineno, obsolete_scdaemon_option (configname, configlineno, "reader-port");
"--reader-port");
break; break;
case octapiDriver: case octapiDriver:
obsolete_scdaemon_option (configname, configlineno, obsolete_scdaemon_option (configname, configlineno, "ctapi-driver");
"--ctapi-driver");
break; break;
case opcscDriver: case opcscDriver:
obsolete_scdaemon_option (configname, configlineno, obsolete_scdaemon_option (configname, configlineno, "pcsc-driver");
"--pcsc-driver");
break; break;
case oDisableCCID: case oDisableCCID:
obsolete_scdaemon_option (configname, configlineno, obsolete_scdaemon_option (configname, configlineno, "disable-ccid");
"--disable-ccid");
break; break;
case oAnswerYes: opt.answer_yes = 1; break; case oAnswerYes: opt.answer_yes = 1; break;

View File

@ -1038,8 +1038,8 @@ obsolete_option (const char *configname, unsigned int configlineno,
log_info (_("%s:%u: obsolete option \"%s\" - it has no effect\n"), log_info (_("%s:%u: obsolete option \"%s\" - it has no effect\n"),
configname, configlineno, name); configname, configlineno, name);
else else
log_info (_("WARNING: \"%s\" is an obsolete option - it has no effect\n"), log_info (_("WARNING: \"%s%s\" is an obsolete option - it has no effect\n"),
name); "--", name);
} }
@ -1052,8 +1052,9 @@ obsolete_scdaemon_option (const char *configname, unsigned int configlineno,
" - it only has effect in %s\n"), " - it only has effect in %s\n"),
configname, configlineno, name, SCDAEMON_NAME EXTSEP_S "conf"); configname, configlineno, name, SCDAEMON_NAME EXTSEP_S "conf");
else else
log_info (_("WARNING: \"%s\" is an obsolete option" log_info (_("WARNING: \"%s%s\" is an obsolete option"
" - it has no effect except on %s\n"), name, SCDAEMON_NAME); " - it has no effect except on %s\n"),
"--", name, SCDAEMON_NAME);
} }