summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Branchaud <marcnarc@xiplink.com>2017-06-21 09:57:38 -0400
committerJunio C Hamano <gitster@pobox.com>2017-06-21 13:53:37 -0700
commit968b1fe263f9dfec65be4598e4f0dd76f1692551 (patch)
tree0081d1940814cc91c2ae6df7863d3ecae517bb72
parent840ed141983718e0c5518a325534a5656797132a (diff)
downloadgit-968b1fe263f9dfec65be4598e4f0dd76f1692551.tar.gz
auto-correct: tweak phrasingmb/reword-autocomplete-message
When help.autoCorrect is enabled, an invalid git command prints a warning and a continuation message, which differs depending on whether or not the value of help.autoCorrect is positive or negative. With help.autoCorrect = 15: WARNING: You called a Git command named 'lgo', which does not exist. Continuing under the assumption that you meant 'log' in 1.5 seconds automatically... With help.autoCorrect < 0: WARNING: You called a Git command named 'lgo', which does not exist. Continuing under the assumption that you meant 'log' The continuation message's phrasing is awkward. This commit cleans it up. As a bonus, we now use full-sentence strings which make translation easier. With help.autoCorrect = 15: WARNING: You called a Git command named 'lgo', which does not exist. Continuing in 1.5 seconds, assuming that you meant 'log'. With help.autoCorrect < 0: WARNING: You called a Git command named 'lgo', which does not exist. Continuing under the assumption that you meant 'log'. Signed-off-by: Marc Branchaud <marcnarc@xiplink.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--help.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/help.c b/help.c
index 2ff3b5a774..2a8ae9758d 100644
--- a/help.c
+++ b/help.c
@@ -386,12 +386,18 @@ const char *help_unknown_cmd(const char *cmd)
clean_cmdnames(&main_cmds);
fprintf_ln(stderr,
_("WARNING: You called a Git command named '%s', "
- "which does not exist.\n"
- "Continuing under the assumption that you meant '%s'"),
- cmd, assumed);
- if (autocorrect > 0) {
- fprintf_ln(stderr, _("in %0.1f seconds automatically..."),
- (float)autocorrect/10.0);
+ "which does not exist."),
+ cmd);
+ if (autocorrect < 0)
+ fprintf_ln(stderr,
+ _("Continuing under the assumption that "
+ "you meant '%s'."),
+ assumed);
+ else {
+ fprintf_ln(stderr,
+ _("Continuing in %0.1f seconds, "
+ "assuming that you meant '%s'."),
+ (float)autocorrect/10.0, assumed);
sleep_millisec(autocorrect * 100);
}
return assumed;