oh-my-fish/plugins/msg/msg.ask.fish
Jorge Bucaran 8e02073145 Add msg plugin. The technicolor message printer.
+ Print messages with style and color easily. Supported styles below:

     _text_                 Bold
     __text__               Underline
     ___text___             Bold and Underline
     `$variable`            Apply @<styles> to $variables
     /directory/            Directories
     [url]                  Links
     \n                     Line Break
     \t                     Tab Space

 + Recognizes 256 different color names and special @random @light @dark @error and @success labels.
 + Included also is `msg.ask` to print a message with `msg` and wait for y/n input. Returns true on y\*.
2015-01-08 04:46:29 +09:00

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