1
Fork 0
mirror of https://github.com/Steffo99/config-fish.git synced 2024-12-22 14:54:23 +00:00
config-fish/functions/confirm.fish
2024-08-21 21:59:02 +02:00

14 lines
No EOL
243 B
Fish

function confirm
log-t "Asking for a" "confirmation" "..."
set -g ANSWER (read -n 1 -P "Confirm? (y/N) ")
if test -z $ANSWER
return 1
else if test $ANSWER = "y"
return 0
else if test $ANSWER = "Y"
return 0
else
return 1
end
end