diff --git a/functions/bkg.fish b/functions/bkg.fish index 4cd5f03..2fc9927 100644 --- a/functions/bkg.fish +++ b/functions/bkg.fish @@ -25,10 +25,7 @@ function bkg --description 'Execute bkg' # Check if a command was provided as an argument. if test -z "$argv[1]" - set -l c_head (set_color --bold cyan) - set -l c_cmd (set_color --bold) - set -l c_arg (set_color cyan) - set -l c_reset (set_color normal) + __fish_palette echo "$c_head""Usage:$c_reset $c_cmd""bkg$c_reset $c_arg"" [arguments...]$c_reset" return 1 end diff --git a/functions/detach.fish b/functions/detach.fish index 9c3af35..997e511 100644 --- a/functions/detach.fish +++ b/functions/detach.fish @@ -25,11 +25,7 @@ # EXAMPLE # detach rsync -a ./data remote:/backup/ function detach --description 'Execute detach' - set -l c_head (set_color --bold cyan) - set -l c_cmd (set_color --bold) - set -l c_flag (set_color yellow) - set -l c_arg (set_color cyan) - set -l c_reset (set_color normal) + __fish_palette set -l show_help 0 set -l args diff --git a/functions/dng2avif.fish b/functions/dng2avif.fish index 5f27505..782c949 100644 --- a/functions/dng2avif.fish +++ b/functions/dng2avif.fish @@ -38,11 +38,7 @@ function dng2avif --description 'Convert DNG raw to 10-bit HDR AVIF' # Help Screen if set -q _flag_help; or test (count $argv) -eq 0 -a -z "$_flag_input" - set -l c_head (set_color --bold cyan) - set -l c_cmd (set_color --bold) - set -l c_flag (set_color yellow) - set -l c_dim (set_color brblack) - set -l c_reset (set_color normal) + __fish_palette echo "$c_head""Usage:$c_reset $c_cmd""dng2avif$c_reset $c_flag""[options]$c_reset $c_dim""[input.dng]$c_reset" echo "" echo "$c_head""Options:$c_reset" diff --git a/functions/edit.fish b/functions/edit.fish index 8bb34b1..b312b83 100644 --- a/functions/edit.fish +++ b/functions/edit.fish @@ -45,12 +45,7 @@ # edit --editor=code --clipboard # edit --text="hello world" function edit --description 'Open files in a terminal or GUI editor with fallbacks' - set -l c_head (set_color --bold cyan) - set -l c_cmd (set_color --bold) - set -l c_flag (set_color yellow) - set -l c_err (set_color red) - set -l c_dim (set_color brblack) - set -l c_reset (set_color normal) + __fish_palette # Opinionated guard (C1): fall back to the legacy bare-editor behavior. if not __fish_config_op_enabled (status current-function) diff --git a/functions/hist.fish b/functions/hist.fish index b21c97c..66ecc11 100644 --- a/functions/hist.fish +++ b/functions/hist.fish @@ -19,8 +19,7 @@ function hist --description 'Search fish history and put it in the prompt' # Opinionated guard (C4): integrations disabled if not __fish_config_op_enabled (status current-function) - set -l c_err (set_color red) - set -l c_reset (set_color normal) + __fish_palette echo "$c_err"'hist: disabled by __fish_config_op_integrations'"$c_reset" >&2 return 1 end diff --git a/functions/open-url.fish b/functions/open-url.fish index 609e515..7c6b2bc 100644 --- a/functions/open-url.fish +++ b/functions/open-url.fish @@ -41,11 +41,7 @@ # NOTES # Typo abbreviation: url-open (expands to open-url on space/enter). function open-url --description 'Open a URL in the best available web browser' - set -l c_head (set_color --bold cyan) - set -l c_cmd (set_color --bold) - set -l c_flag (set_color yellow) - set -l c_arg (set_color cyan) - set -l c_reset (set_color normal) + __fish_palette argparse h/help s/silent v/verbose -- $argv or return 1 diff --git a/functions/p.fish b/functions/p.fish index 7a85cab..2c5562a 100644 --- a/functions/p.fish +++ b/functions/p.fish @@ -28,11 +28,7 @@ function p --description 'Put from clipboard' # Check for help flag if contains -- -h $argv; or contains -- --help $argv - set -l c_head (set_color --bold cyan) - set -l c_cmd (set_color --bold) - set -l c_flag (set_color yellow) - set -l c_dim (set_color brblack) - set -l c_reset (set_color normal) + __fish_palette echo "$c_head""Usage:$c_reset $c_cmd""p$c_reset $c_flag""[OPTIONS]$c_reset" echo "" echo " Pastes content from the system clipboard to stdout." diff --git a/functions/play-media.fish b/functions/play-media.fish index 1a81041..63cc34c 100644 --- a/functions/play-media.fish +++ b/functions/play-media.fish @@ -36,11 +36,7 @@ # play-media # play-media --player mpv function play-media --description 'Pick audio/video files with fzf and play them' - set -l c_head (set_color --bold cyan) - set -l c_cmd (set_color --bold) - set -l c_flag (set_color yellow) - set -l c_dim (set_color brblack) - set -l c_reset (set_color normal) + __fish_palette argparse h/help p/player= -- $argv or return 1