mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-12-03 14:53:41 +08:00
13 lines
235 B
Fish
13 lines
235 B
Fish
|
# Print a message with msg and wait for y/n input. Return true on y\*.
|
||
|
# @params → msg.fish
|
||
|
function msg.ask
|
||
|
msg $argv
|
||
|
head -n 1 | read answer
|
||
|
switch $answer
|
||
|
case y\* Y\*
|
||
|
return 0
|
||
|
case \*
|
||
|
return 1
|
||
|
end
|
||
|
end
|