1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-07 02:16:09 +02:00

help: make auto-correction prompt more consistent

There are three callsites of git_prompt() helper function that ask a
"yes/no" question to the end user, but one of them in help.c that
asks if the suggested auto-correction is OK, which is given when the
user makes a possible typo in a Git subcommand name, is formatted
differently from the others.

Update the format string to make the prompt string look more
consistent.

Signed-off-by: Kashav Madan <kshvmdn@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Kashav Madan 2021-12-15 22:58:58 +00:00 committed by Junio C Hamano
parent e9d7761bb9
commit 0fc8ed154c

2
help.c
View File

@ -643,7 +643,7 @@ const char *help_unknown_cmd(const char *cmd)
else if (autocorrect == AUTOCORRECT_PROMPT) {
char *answer;
struct strbuf msg = STRBUF_INIT;
strbuf_addf(&msg, _("Run '%s' instead? (y/N)"), assumed);
strbuf_addf(&msg, _("Run '%s' instead [y/N]? "), assumed);
answer = git_prompt(msg.buf, PROMPT_ECHO);
strbuf_release(&msg);
if (!(starts_with(answer, "y") ||