[PATCHv2 (resend)] Tweak help auto-correct phrasing.
- From
Marc Branchaud <marcnarc@xiplink.com>
- Date
- Jun 21, 2017, 13:57 UTC
- Message-ID
- <20170621135738.27948-1-marcnarc@xiplink.com>
- In-Reply-To
- <3164ca01-9b54-3c9b-96d8-182c9fbbceb9@xiplink.com>
When auto-correct is enabled, an invalid git command prints a warning and a continuation message, which differs depending on whether or not 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> ---
So here's the patch again.
M.
help.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/help.c b/help.c index f637fc800..69966c174 100644 --- a/help.c +++ b/help.c @@ -356,12 +356,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;
-- 2.13.1.388.g69e6b9b4f.dirty