Re: [PATCH v3] add-patch: enforce only one-letter response to prompts
- From
Rubén Justo <rjusto@gmail.com>
- Date
- May 22, 2024, 17:38 UTC
- Message-ID
- <e9f41db1-741c-413f-81ce-a86b1802e507@gmail.com>
- In-Reply-To
- <xmqqikz56a6o.fsf_-_@gitster.g>
On Wed, May 22, 2024 at 10:14:23AM -0700, Junio C Hamano wrote:
> + if (s->answer.len != 1 && (ch != 'g' && ch != '/')) {This "len!=1" introduces a nice dose of sanity in the UI.
> + error(_("only one letter is expected, got '%s'"), s->answer.buf);Here, perhaps you want to do:
err(s, _("Only one letter is expected, got '%s'"), s->answer.buf);