dotfiles/.config/fish/functions/read_confirm.fish

14 lines
183 B
Fish

function read_confirm
while true
read -l -P "$argv[1] [y/N] " confirm
switch $confirm
case Y y
return 0
case '' N n
return 1
end
end
end