aboutsummaryrefslogtreecommitdiff
path: root/conf.d/00functions.fish
diff options
context:
space:
mode:
Diffstat (limited to 'conf.d/00functions.fish')
-rw-r--r--conf.d/00functions.fish10
1 files changed, 10 insertions, 0 deletions
diff --git a/conf.d/00functions.fish b/conf.d/00functions.fish
index f390b29..d1ad87b 100644
--- a/conf.d/00functions.fish
+++ b/conf.d/00functions.fish
@@ -34,3 +34,13 @@ function find_prog --description "Find one or more programs in \$PATH"
end
end
end
+
+function ask --description "Ask a question answered by yes or no"
+ read -n 1 -f -P (set_color -o blue)"::"(set_color normal)" $argv[1] [y/N] " answer
+ switch $answer
+ case y Y
+ return 0 # yes
+ case '*'
+ return 1 # no
+ end
+end