funced: Use a read prompt *string*

This used a prompt command, but since the prompt was interpolated and
included a `?` it would be run as a glob without qmark-noglob.

Since it's simpler to pass a prompt string, just do that.
This commit is contained in:
Fabian Boehm 2022-09-10 17:42:16 +02:00
parent 79642995f1
commit a750b28eb4

View file

@ -120,7 +120,7 @@ function funced --description 'Edit function definition'
echo # add a line between the parse error and the prompt
set -l repeat
set -l prompt (_ 'Edit the file again? [Y/n]')
read -p "echo $prompt\ " response
read -P "$prompt " response
if test -z "$response"
or contains $response {Y,y}{E,e,}{S,s,}
continue