From c76ce97d0359698dcb45be43df28e26a10e3d5bd Mon Sep 17 00:00:00 2001 From: Jorge Bucaran Date: Fri, 9 Jan 2015 14:10:02 +0900 Subject: [PATCH] Add ability to escape -s and -n options using a backslash. Add notes in comments about escaping. --- plugins/msg/msg.fish | 413 +++---------------------------------------- 1 file changed, 27 insertions(+), 386 deletions(-) diff --git a/plugins/msg/msg.fish b/plugins/msg/msg.fish index 835bc14..8441266 100644 --- a/plugins/msg/msg.fish +++ b/plugins/msg/msg.fish @@ -3,33 +3,38 @@ # /_/_/_/___/\_, / # /___/ v0.1.0 # NAME -# msg - technicolor message printer +# msg - technicolor message printer # # SYNOPSIS -# msg [-sn] [@ | style][style] +# msg [-sn] [@ | style][style] # # OPTIONS -# -s -# Do not separate arguments with spaces. -# -n -# Do not output a newline at the end of the message. +# -s +# Do not separate arguments with spaces. +# -n +# Do not output a newline at the end of the message. # # STYLES -# _text_ Bold -# __text__ Underline -# ___text___ Bold and Underline -# `$variable` Apply @ to $variables -# /directory/ Directories -# [url] Links -# \n Line Break -# \t Tab Space +# _text_ Bold +# __text__ Underline +# ___text___ Bold and Underline +# `$variable` Apply @ to $variables +# /directory/ Directories +# [url] Links +# \n Line Break +# \t Tab Space # -# @ fg=bg=RGB|RRGGBB|name|random -# RGB value can be any three to six hex digit or color name. -# e.g, @0fb, @tomato, @random, @error, @ok. +# @ fg=bg=RGB|RRGGBB|name|random +# RGB value can be any three to six hex digit or color name. +# e.g, @0fb, @tomato, @random, @error, @ok. +# +# NOTES +# Escape style separators or options prepending a \ to the +# string if inside quotes `msg "\-s"` or a \\ backslash in +# order to escape the backslash itself when outside quotes. # # AUTHORS -# @bucaran (Jorge Bucaran) +# Jorge Bucaran # # v. 0.1.0 #/ @@ -42,28 +47,6 @@ set --global msg_style_dir FFA500 $msg_color_bg -u set --global msg_color_err FF0000 set --global msg_color_ok 00FA9A -# Set style, fg/bg colors and reset. Modifies its parent scope of `msg`. -# @params [] [] [