config/.config/fish/functions/confirm.fish

13 lines
305 B
Fish

function confirm --description "Ask for user confirmation" --argument-names prompt
while true
read --local --prompt-str="$prompt [y/N] " confirmed
switch $confirmed
case Y y
return 0
case '' N n
return 1
end
end
end