add-patch: response to unknown commandrj/add-p-typo-reaction
commit26998ed2a2ed2e36103da7131e44cd6a0c8d4565
authorRubén Justo <rjusto@gmail.com>
Mon, 29 Apr 2024 18:37:12 +0000 (29 20:37 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 30 Apr 2024 19:02:50 +0000 (30 12:02 -0700)
tree2eb6d3cd287a6cc725d5df6f0a0215ef3a3be797
parent9d225b025d96d37e8c914646c54cfa9fb5f52b80
add-patch: response to unknown command

When the user gives an unknown command to the "add -p" prompt, the list
of accepted commands with their explanation is given.  This is the same
output they get when they say '?'.

However, the unknown command may be due to a user input error rather
than the user not knowing the valid command.

To reduce the likelihood of user confusion and error repetition, instead
of displaying the list of accepted commands, display a short error
message with the unknown command received, as feedback to the user.

Include a reminder about the current command '?' in the new message, to
guide the user if they want help.

Signed-off-by: Rubén Justo <rjusto@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
add-patch.c
t/t3701-add-interactive.sh