1
Fork 0
mirror of https://github.com/Steffo99/config-fish.git synced 2024-10-16 14:27:34 +00:00
config-fish/functions/confirm.fish

14 lines
243 B
Fish
Raw Normal View History

2021-07-15 00:49:45 +00:00
function confirm
2024-08-21 19:59:02 +00:00
log-t "Asking for a" "confirmation" "..."
set -g ANSWER (read -n 1 -P "Confirm? (y/N) ")
2021-07-15 00:49:45 +00:00
2024-08-21 19:59:02 +00:00
if test -z $ANSWER
return 1
else if test $ANSWER = "y"
return 0
else if test $ANSWER = "Y"
return 0
else
return 1
end
2021-07-15 00:49:45 +00:00
end