refactor(functions): consolidate 198 duplicate color declarations into one helper #131
@@ -30,11 +30,7 @@ function dockup --description 'Pull and restart docker compose containers'
|
|||||||
|
|
||||||
# Handle help flags
|
# Handle help flags
|
||||||
if contains -- -h $argv; or contains -- --help $argv
|
if contains -- -h $argv; or contains -- --help $argv
|
||||||
set -l c_head (set_color --bold cyan)
|
__fish_palette
|
||||||
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)
|
|
||||||
echo "$c_head""Usage:$c_reset $c_cmd""dockup$c_reset $c_dim""[DIRECTORY]$c_reset"
|
echo "$c_head""Usage:$c_reset $c_cmd""dockup$c_reset $c_dim""[DIRECTORY]$c_reset"
|
||||||
echo ""
|
echo ""
|
||||||
echo "$c_head""Options:$c_reset"
|
echo "$c_head""Options:$c_reset"
|
||||||
|
|||||||
@@ -93,11 +93,7 @@ end
|
|||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# __fish_deps_help
|
# __fish_deps_help
|
||||||
function __fish_deps_help
|
function __fish_deps_help
|
||||||
set -l c_head (set_color --bold cyan)
|
__fish_palette
|
||||||
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)
|
|
||||||
|
|
||||||
echo "$c_head""fish-deps$c_reset — manage fish shell dependencies"
|
echo "$c_head""fish-deps$c_reset — manage fish shell dependencies"
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
@@ -51,14 +51,7 @@
|
|||||||
# redirections must be wrapped explicitly, e.g.
|
# redirections must be wrapped explicitly, e.g.
|
||||||
# jobrunner run sync fish -c 'a | b'.
|
# jobrunner run sync fish -c 'a | b'.
|
||||||
function jobrunner --description 'Manage detached background jobs with tmux or GNU screen'
|
function jobrunner --description 'Manage detached background jobs with tmux or GNU screen'
|
||||||
set -l c_head (set_color --bold cyan)
|
__fish_palette
|
||||||
set -l c_cmd (set_color --bold)
|
|
||||||
set -l c_arg (set_color cyan)
|
|
||||||
set -l c_flag (set_color yellow)
|
|
||||||
set -l c_ok (set_color green)
|
|
||||||
set -l c_err (set_color red)
|
|
||||||
set -l c_dim (set_color brblack)
|
|
||||||
set -l c_reset (set_color normal)
|
|
||||||
|
|
||||||
set -l subcmds run list attach kill logs help \
|
set -l subcmds run list attach kill logs help \
|
||||||
-r --run -l --list -a --attach -k --kill -o --output -h --help
|
-r --run -l --list -a --attach -k --kill -o --output -h --help
|
||||||
|
|||||||
@@ -38,14 +38,7 @@
|
|||||||
# kitty-logging install
|
# kitty-logging install
|
||||||
# kitty-logging status
|
# kitty-logging status
|
||||||
function kitty-logging --description 'Install/manage the fish-config Kitty scrollback watcher'
|
function kitty-logging --description 'Install/manage the fish-config Kitty scrollback watcher'
|
||||||
set -l c_head (set_color --bold cyan)
|
__fish_palette
|
||||||
set -l c_cmd (set_color --bold)
|
|
||||||
set -l c_flag (set_color yellow)
|
|
||||||
set -l c_ok (set_color green)
|
|
||||||
set -l c_warn (set_color yellow)
|
|
||||||
set -l c_err (set_color red)
|
|
||||||
set -l c_dim (set_color brblack)
|
|
||||||
set -l c_reset (set_color normal)
|
|
||||||
|
|
||||||
set -l cmd $argv[1]
|
set -l cmd $argv[1]
|
||||||
|
|
||||||
|
|||||||
+1
-8
@@ -46,14 +46,7 @@ function pkg --description 'Install or remove packages via the system package ma
|
|||||||
end
|
end
|
||||||
|
|
||||||
# ── Colour palette ───────────────────────────────────────────
|
# ── Colour palette ───────────────────────────────────────────
|
||||||
set -l c_head (set_color --bold cyan)
|
__fish_palette
|
||||||
set -l c_cmd (set_color --bold)
|
|
||||||
set -l c_flag (set_color yellow)
|
|
||||||
set -l c_ok (set_color green)
|
|
||||||
set -l c_warn (set_color yellow)
|
|
||||||
set -l c_err (set_color red)
|
|
||||||
set -l c_dim (set_color brblack)
|
|
||||||
set -l c_reset (set_color normal)
|
|
||||||
|
|
||||||
# ── Installed-check helper ───────────────────────────────────
|
# ── Installed-check helper ───────────────────────────────────
|
||||||
# Uses only its own arguments — safe to define as an inner function.
|
# Uses only its own arguments — safe to define as an inner function.
|
||||||
|
|||||||
@@ -63,10 +63,7 @@ function scrub --description 'Recursively purge OS, editor, and compiler garbage
|
|||||||
|
|
||||||
# Helper function for help menu text
|
# Helper function for help menu text
|
||||||
function _scrub_help
|
function _scrub_help
|
||||||
set -l c_head (set_color --bold cyan)
|
__fish_palette
|
||||||
set -l c_cmd (set_color --bold)
|
|
||||||
set -l c_flag (set_color yellow)
|
|
||||||
set -l c_reset (set_color normal)
|
|
||||||
|
|
||||||
echo "$c_head""Usage:$c_reset $c_cmd""scrub$c_reset $c_flag""[options]$c_reset"
|
echo "$c_head""Usage:$c_reset $c_cmd""scrub$c_reset $c_flag""[options]$c_reset"
|
||||||
echo
|
echo
|
||||||
|
|||||||
@@ -23,8 +23,7 @@
|
|||||||
function upgrade --description 'Full system upgrade via paru or yay'
|
function upgrade --description 'Full system upgrade via paru or yay'
|
||||||
# Opinionated guard (C4): integrations disabled
|
# Opinionated guard (C4): integrations disabled
|
||||||
if not __fish_config_op_enabled (status current-function)
|
if not __fish_config_op_enabled (status current-function)
|
||||||
set -l c_err (set_color red)
|
__fish_palette
|
||||||
set -l c_reset (set_color normal)
|
|
||||||
echo "$c_err"'upgrade: disabled by __fish_config_op_integrations'"$c_reset" >&2
|
echo "$c_err"'upgrade: disabled by __fish_config_op_integrations'"$c_reset" >&2
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -23,10 +23,7 @@
|
|||||||
# wake-lock rsync -avz src/ dest/
|
# wake-lock rsync -avz src/ dest/
|
||||||
function wake-lock --description 'Run a command while inhibiting system sleep'
|
function wake-lock --description 'Run a command while inhibiting system sleep'
|
||||||
if test (count $argv) -eq 0
|
if test (count $argv) -eq 0
|
||||||
set -l c_head (set_color --bold cyan)
|
__fish_palette
|
||||||
set -l c_cmd (set_color --bold)
|
|
||||||
set -l c_arg (set_color cyan)
|
|
||||||
set -l c_reset (set_color normal)
|
|
||||||
echo "$c_head""Usage:$c_reset $c_cmd""wake-lock$c_reset $c_arg""[command] [args...]$c_reset"
|
echo "$c_head""Usage:$c_reset $c_cmd""wake-lock$c_reset $c_arg""[command] [args...]$c_reset"
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user