diff --git a/functions/agents-init.fish b/functions/agents-init.fish index ff002fa..5814379 100644 --- a/functions/agents-init.fish +++ b/functions/agents-init.fish @@ -77,7 +77,7 @@ # agents-init --quiet function agents-init --description 'scaffold AGENTS/ sub-repo with agent spec files and plugin dirs' set -l c_head (set_color --bold cyan) - set -l c_cmd (set_color --bold white) + 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) diff --git a/functions/auto-pull.fish b/functions/auto-pull.fish index 1472aaf..a012092 100644 --- a/functions/auto-pull.fish +++ b/functions/auto-pull.fish @@ -43,7 +43,7 @@ # auto-pull remove qmk_firmware function auto-pull --description 'Manage the auto-pull repository registry' set -l c_head (set_color --bold cyan) - set -l c_cmd (set_color --bold white) + 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) diff --git a/functions/bkg.fish b/functions/bkg.fish index 979da98..4cd5f03 100644 --- a/functions/bkg.fish +++ b/functions/bkg.fish @@ -25,7 +25,11 @@ function bkg --description 'Execute bkg' # Check if a command was provided as an argument. if test -z "$argv[1]" - echo "Usage: bkg [arguments...]" + 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) + echo "$c_head""Usage:$c_reset $c_cmd""bkg$c_reset $c_arg"" [arguments...]$c_reset" return 1 end diff --git a/functions/config-settings.fish b/functions/config-settings.fish index 4f289de..4ac0260 100644 --- a/functions/config-settings.fish +++ b/functions/config-settings.fish @@ -70,7 +70,7 @@ # config-settings function config-settings --description 'Interactive TUI for managing fish config settings' set -l c_head (set_color --bold cyan) - set -l c_cmd (set_color --bold white) + set -l c_cmd (set_color --bold) set -l c_flag (set_color yellow) set -l c_dim (set_color brblack) set -l c_err (set_color red) diff --git a/functions/config-update.fish b/functions/config-update.fish index b4de9be..37bf5f4 100644 --- a/functions/config-update.fish +++ b/functions/config-update.fish @@ -28,7 +28,7 @@ # config-update --force function config-update --description 'Pull latest fish config from upstream' set -l c_head (set_color --bold cyan) - set -l c_cmd (set_color --bold white) + 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) diff --git a/functions/detach.fish b/functions/detach.fish index e824239..9c3af35 100644 --- a/functions/detach.fish +++ b/functions/detach.fish @@ -25,6 +25,12 @@ # 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) + set -l show_help 0 set -l args @@ -45,16 +51,16 @@ function detach --description 'Execute detach' end if test $show_help -eq 1 - echo "Usage: detach [command...]" - echo "Runs a command in the background, fully detached from the terminal." + echo "$c_head""Usage:$c_reset $c_cmd""detach$c_reset $c_arg""[command...]$c_reset" + echo " Runs a command in the background, fully detached from the terminal." echo - echo "Options:" - echo " -h, --help Show this help message" - echo " --version Show version information" + echo "$c_head""Options:$c_reset" + echo " $c_flag-h$c_reset, $c_flag--help$c_reset Show this help message" + echo " $c_flag--version$c_reset Show version information" echo - echo "Example:" - echo " detach firefox" - echo " detach rsync -a ./data remote:/backup/" + echo "$c_head""Example:$c_reset" + echo " $c_cmd""detach$c_reset firefox" + echo " $c_cmd""detach$c_reset rsync -a ./data remote:/backup/" return end diff --git a/functions/dng2avif.fish b/functions/dng2avif.fish index 828895c..5f27505 100644 --- a/functions/dng2avif.fish +++ b/functions/dng2avif.fish @@ -38,14 +38,19 @@ 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" - echo "Usage: dng2avif [options] [input.dng]" + 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) + echo "$c_head""Usage:$c_reset $c_cmd""dng2avif$c_reset $c_flag""[options]$c_reset $c_dim""[input.dng]$c_reset" echo "" - echo "Options:" - echo " -i, --input FILE Input DNG file" - echo " -o, --output FILE Output AVIF file (defaults to input name)" - echo " -q, --quality N Encoding quality 0-100 (default: 92)" - echo " -s, --speed N Encoder speed 0-10 (default: 3, 0=slowest)" - echo " -h, --help Show this help message" + echo "$c_head""Options:$c_reset" + echo " $c_flag-i$c_reset, $c_flag--input$c_reset $c_dim""FILE$c_reset Input DNG file" + echo " $c_flag-o$c_reset, $c_flag--output$c_reset $c_dim""FILE$c_reset Output AVIF file (defaults to input name)" + echo " $c_flag-q$c_reset, $c_flag--quality$c_reset $c_dim""N$c_reset Encoding quality 0-100 (default: 92)" + echo " $c_flag-s$c_reset, $c_flag--speed$c_reset $c_dim""N$c_reset Encoder speed 0-10 (default: 3, 0=slowest)" + echo " $c_flag-h$c_reset, $c_flag--help$c_reset Show this help message" return 0 end diff --git a/functions/dockup.fish b/functions/dockup.fish index 22a4751..2f2fbf8 100644 --- a/functions/dockup.fish +++ b/functions/dockup.fish @@ -30,13 +30,18 @@ function dockup --description 'Pull and restart docker compose containers' # Handle help flags if contains -- -h $argv; or contains -- --help $argv - echo (set_color -o yellow)"Usage:"$clr_off" dockup [DIRECTORY]" + 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) + echo "$c_head""Usage:$c_reset $c_cmd""dockup$c_reset $c_dim""[DIRECTORY]$c_reset" echo "" - echo (set_color -u)"Options:"$clr_off - echo " -h, --help Show this help message" + echo "$c_head""Options:$c_reset" + echo " $c_flag-h$c_reset, $c_flag--help$c_reset Show this help message" echo "" - echo (set_color -u)"Arguments:"$clr_off - echo " DIRECTORY Optional path to the compose project (defaults to current dir)" + echo "$c_head""Arguments:$c_reset" + echo " $c_dim""DIRECTORY$c_reset Optional path to the compose project (defaults to current dir)" return 0 end diff --git a/functions/edit.fish b/functions/edit.fish index ed178b4..8bb34b1 100644 --- a/functions/edit.fish +++ b/functions/edit.fish @@ -46,7 +46,7 @@ # 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 white) + 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) diff --git a/functions/fish-deps.fish b/functions/fish-deps.fish index 001ef13..b0860e6 100644 --- a/functions/fish-deps.fish +++ b/functions/fish-deps.fish @@ -93,18 +93,24 @@ end # EXAMPLE # __fish_deps_help function __fish_deps_help - set_color cyan; echo "fish-deps — manage fish shell dependencies"; set_color normal + 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) + + echo "$c_head""fish-deps$c_reset — manage fish shell dependencies" echo "" - echo "Usage:" - echo " fish-deps [status] Check installed/missing deps (default)" - echo " fish-deps install Install missing deps interactively" - echo " fish-deps update Update all installed deps" - echo " fish-deps sync Install missing, then update all" + echo "$c_head""Usage:$c_reset" + echo " $c_cmd""fish-deps$c_reset $c_dim""[status]$c_reset Check installed/missing deps (default)" + echo " $c_cmd""fish-deps$c_reset install Install missing deps interactively" + echo " $c_cmd""fish-deps$c_reset update Update all installed deps" + echo " $c_cmd""fish-deps$c_reset sync Install missing, then update all" echo "" echo " install/sync accept:" - echo " --optional Also offer Optional-tier deps (skipped by default)" - echo " --terminals Also offer Terminal-Emulator-tier deps (skipped by default)" - echo " --all Shorthand for --optional --terminals" + echo " $c_flag--optional$c_reset Also offer Optional-tier deps (skipped by default)" + echo " $c_flag--terminals$c_reset Also offer Terminal-Emulator-tier deps (skipped by default)" + echo " $c_flag--all$c_reset Shorthand for --optional --terminals" echo "" echo "Install method priority: cargo > system PM > git/curl/pipx" echo "When multiple methods are available, you will be prompted to choose." diff --git a/functions/jobrunner.fish b/functions/jobrunner.fish index 260cc90..33951d0 100644 --- a/functions/jobrunner.fish +++ b/functions/jobrunner.fish @@ -52,13 +52,13 @@ # `jobrunner run sync fish -c 'a | b'`. function jobrunner --description 'Manage detached background jobs with tmux or GNU screen' set -l c_head (set_color --bold cyan) - set -l c_cmd (set_color --bold white) + 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_rst (set_color normal) + set -l c_reset (set_color normal) set -l subcmds run list attach kill logs help \ -r --run -l --list -a --attach -k --kill -o --output -h --help @@ -104,34 +104,34 @@ function jobrunner --description 'Manage detached background jobs with tmux or G # ╰──────────────────────────────────────────────────────────╯ # Answered before the dependency check so usage is readable anywhere. if set -q argv[1]; and contains -- $argv[1] help -h --help - echo "$c_head""Usage:$c_rst $c_cmd""jobrunner$c_rst $c_arg""[] [] [...]$c_rst" + echo "$c_head""Usage:$c_reset $c_cmd""jobrunner$c_reset $c_arg""[] [] [...]$c_reset" echo echo " Run and manage named background jobs backed by tmux or GNU screen." - echo " If $c_arg$c_rst is omitted, a random memorable name is generated." + echo " If $c_arg$c_reset is omitted, a random memorable name is generated." echo - echo "$c_head""Subcommands:$c_rst" - echo " $c_cmd""run$c_rst, $c_flag-r$c_rst, $c_flag--run$c_rst $c_arg""[-n ] $c_rst Start a new background job" - echo " $c_cmd""list$c_rst, $c_flag-l$c_rst, $c_flag--list$c_rst List all running jobs (default)" - echo " $c_cmd""attach$c_rst, $c_flag-a$c_rst, $c_flag--attach$c_rst $c_arg""$c_rst Attach to a running job's terminal" - echo " $c_cmd""kill$c_rst, $c_flag-k$c_rst, $c_flag--kill$c_rst $c_arg""$c_rst Terminate a running background job" - echo " $c_cmd""logs$c_rst, $c_flag-o$c_rst, $c_flag--output$c_rst $c_arg""$c_rst Print a job's current output, no attach" - echo " $c_cmd""help$c_rst, $c_flag-h$c_rst, $c_flag--help$c_rst Show usage help" + echo "$c_head""Subcommands:$c_reset" + echo " $c_cmd""run$c_reset, $c_flag-r$c_reset, $c_flag--run$c_reset $c_arg""[-n ] $c_reset Start a new background job" + echo " $c_cmd""list$c_reset, $c_flag-l$c_reset, $c_flag--list$c_reset List all running jobs (default)" + echo " $c_cmd""attach$c_reset, $c_flag-a$c_reset, $c_flag--attach$c_reset $c_arg""$c_reset Attach to a running job's terminal" + echo " $c_cmd""kill$c_reset, $c_flag-k$c_reset, $c_flag--kill$c_reset $c_arg""$c_reset Terminate a running background job" + echo " $c_cmd""logs$c_reset, $c_flag-o$c_reset, $c_flag--output$c_reset $c_arg""$c_reset Print a job's current output, no attach" + echo " $c_cmd""help$c_reset, $c_flag-h$c_reset, $c_flag--help$c_reset Show usage help" echo - echo "$c_head""Options:$c_rst" - echo " $c_flag-t$c_rst, $c_flag--tool$c_rst $c_arg""$c_rst Force backend tool ('tmux' or 'screen')" - echo " $c_flag-n$c_rst, $c_flag--name$c_rst $c_arg""$c_rst Set explicit name for a new job" + echo "$c_head""Options:$c_reset" + echo " $c_flag-t$c_reset, $c_flag--tool$c_reset $c_arg""$c_reset Force backend tool ('tmux' or 'screen')" + echo " $c_flag-n$c_reset, $c_flag--name$c_reset $c_arg""$c_reset Set explicit name for a new job" echo - echo "$c_head""Shortcuts:$c_rst" - echo " $c_cmd""jobrunner$c_rst $c_arg""$c_rst $c_dim""attach $c_rst" - echo " $c_cmd""jobrunner$c_rst $c_arg""[-n ] ...$c_rst$c_dim""run [-n ] ...$c_rst" + echo "$c_head""Shortcuts:$c_reset" + echo " $c_cmd""jobrunner$c_reset $c_arg""$c_reset $c_dim""attach $c_reset" + echo " $c_cmd""jobrunner$c_reset $c_arg""[-n ] ...$c_reset$c_dim""run [-n ] ...$c_reset" echo - echo "$c_head""Examples:$c_rst" - echo " $c_cmd""jobrunner$c_rst $c_arg""run -n build$c_rst""$c_dim"" make -j8$c_rst" - echo " $c_cmd""jobrunner$c_rst $c_arg""sleep 1000$c_rst" - echo " $c_cmd""jobrunner$c_rst $c_arg""logs build$c_rst" - echo " $c_cmd""jobrunner$c_rst $c_arg""kill build$c_rst" + echo "$c_head""Examples:$c_reset" + echo " $c_cmd""jobrunner$c_reset $c_arg""run -n build$c_reset""$c_dim"" make -j8$c_reset" + echo " $c_cmd""jobrunner$c_reset $c_arg""sleep 1000$c_reset" + echo " $c_cmd""jobrunner$c_reset $c_arg""logs build$c_reset" + echo " $c_cmd""jobrunner$c_reset $c_arg""kill build$c_reset" echo - echo "$c_dim""Detach from an attached job with Ctrl-A then D.$c_rst" + echo "$c_dim""Detach from an attached job with Ctrl-A then D.$c_reset" return 0 end @@ -140,11 +140,11 @@ function jobrunner --description 'Manage detached background jobs with tmux or G # ╰──────────────────────────────────────────────────────────╯ if test -n "$tool" if not contains -- $tool tmux screen - echo "$c_err""jobrunner:$c_rst invalid tool '$c_arg$tool$c_rst', must be 'tmux' or 'screen'." >&2 + echo "$c_err""jobrunner:$c_reset invalid tool '$c_arg$tool$c_reset', must be 'tmux' or 'screen'." >&2 return 1 end if not command -q $tool - echo "$c_err""jobrunner:$c_rst '$tool' is required but was not found in PATH." >&2 + echo "$c_err""jobrunner:$c_reset '$tool' is required but was not found in PATH." >&2 return 127 end else @@ -153,7 +153,7 @@ function jobrunner --description 'Manage detached background jobs with tmux or G else if command -q screen set tool screen else - echo "$c_err""jobrunner:$c_rst neither 'tmux' nor 'screen' was found in PATH." >&2 + echo "$c_err""jobrunner:$c_reset neither 'tmux' nor 'screen' was found in PATH." >&2 return 127 end end @@ -171,8 +171,8 @@ function jobrunner --description 'Manage detached background jobs with tmux or G set argv attach $argv set cmd attach else - echo "$c_err""jobrunner:$c_rst unknown subcommand or job '$c_arg$cmd$c_rst'." >&2 - echo "Run $c_cmd""jobrunner --help$c_rst for usage." >&2 + echo "$c_err""jobrunner:$c_reset unknown subcommand or job '$c_arg$cmd$c_reset'." >&2 + echo "Run $c_cmd""jobrunner --help$c_reset for usage." >&2 return 1 end else @@ -207,7 +207,7 @@ function jobrunner --description 'Manage detached background jobs with tmux or G end if test (count $argv) -lt 2 - echo "$c_head""Usage:$c_rst $c_cmd""jobrunner run$c_rst $c_arg""[-n ] ...$c_rst" >&2 + echo "$c_head""Usage:$c_reset $c_cmd""jobrunner run$c_reset $c_arg""[-n ] ...$c_reset" >&2 return 1 end @@ -218,11 +218,11 @@ function jobrunner --description 'Manage detached background jobs with tmux or G # screen stores each session as a socket file named after it. if string match -q '*/*' -- $name - echo "$c_err""jobrunner:$c_rst job name may not contain '/'." >&2 + echo "$c_err""jobrunner:$c_reset job name may not contain '/'." >&2 return 1 end if contains -- $name (__jobrunner_sessions $tool | string replace -r '\t.*$' '') - echo "$c_err""jobrunner:$c_rst job '$c_arg$name$c_rst' is already running." >&2 + echo "$c_err""jobrunner:$c_reset job '$c_arg$name$c_reset' is already running." >&2 return 1 end @@ -232,7 +232,7 @@ function jobrunner --description 'Manage detached background jobs with tmux or G command screen -d -m -S $name $task end or begin - echo "$c_err""jobrunner:$c_rst failed to start job '$c_arg$name$c_rst'." >&2 + echo "$c_err""jobrunner:$c_reset failed to start job '$c_arg$name$c_reset'." >&2 return 1 end @@ -243,10 +243,10 @@ function jobrunner --description 'Manage detached background jobs with tmux or G end if set -q pid[1] - echo "$c_ok""✔$c_rst Started job $c_arg$name$c_rst $c_dim(PID $pid)$c_rst" + echo "$c_ok""✔$c_reset Started job $c_arg$name$c_reset $c_dim(PID $pid)$c_reset" else # The job may have finished (or failed) before we looked. - echo "$c_ok""✔$c_rst Started job $c_arg$name$c_rst $c_dim(already exited)$c_rst" + echo "$c_ok""✔$c_reset Started job $c_arg$name$c_reset $c_dim(already exited)$c_reset" end case list -l --list @@ -256,21 +256,21 @@ function jobrunner --description 'Manage detached background jobs with tmux or G return 0 end - printf '%s%-20s %-8s %-10s %s%s\n' "$c_head" JOB PID STATE STARTED "$c_rst" + printf '%s%-20s %-8s %-10s %s%s\n' "$c_head" JOB PID STATE STARTED "$c_reset" for row in $rows set -l f (string split \t -- $row) printf '%s%-20s%s %-8s %-10s %s%s%s\n' \ - "$c_arg" $f[1] "$c_rst" $f[2] $f[3] "$c_dim" $f[4] "$c_rst" + "$c_arg" $f[1] "$c_reset" $f[2] $f[3] "$c_dim" $f[4] "$c_reset" end case attach -a --attach if test (count $argv) -ne 2 - echo "$c_head""Usage:$c_rst $c_cmd""jobrunner attach$c_rst $c_arg""$c_rst" >&2 + echo "$c_head""Usage:$c_reset $c_cmd""jobrunner attach$c_reset $c_arg""$c_reset" >&2 return 1 end set -l name $argv[2] if not contains -- $name (__jobrunner_sessions $tool | string replace -r '\t.*$' '') - echo "$c_err""jobrunner:$c_rst no such job '$c_arg$name$c_rst'." >&2 + echo "$c_err""jobrunner:$c_reset no such job '$c_arg$name$c_reset'." >&2 return 1 end if test "$tool" = tmux @@ -282,12 +282,12 @@ function jobrunner --description 'Manage detached background jobs with tmux or G case kill -k --kill if test (count $argv) -ne 2 - echo "$c_head""Usage:$c_rst $c_cmd""jobrunner kill$c_rst $c_arg""$c_rst" >&2 + echo "$c_head""Usage:$c_reset $c_cmd""jobrunner kill$c_reset $c_arg""$c_reset" >&2 return 1 end set -l name $argv[2] if not contains -- $name (__jobrunner_sessions $tool | string replace -r '\t.*$' '') - echo "$c_err""jobrunner:$c_rst no such job '$c_arg$name$c_rst'." >&2 + echo "$c_err""jobrunner:$c_reset no such job '$c_arg$name$c_reset'." >&2 return 1 end if test "$tool" = tmux @@ -296,19 +296,19 @@ function jobrunner --description 'Manage detached background jobs with tmux or G command screen -X -S $name quit end or begin - echo "$c_err""jobrunner:$c_rst failed to terminate job '$c_arg$name$c_rst'." >&2 + echo "$c_err""jobrunner:$c_reset failed to terminate job '$c_arg$name$c_reset'." >&2 return 1 end - echo "$c_ok""✔$c_rst Terminated job $c_arg$name$c_rst" + echo "$c_ok""✔$c_reset Terminated job $c_arg$name$c_reset" case logs -o --output if test (count $argv) -ne 2 - echo "$c_head""Usage:$c_rst $c_cmd""jobrunner logs$c_rst $c_arg""$c_rst" >&2 + echo "$c_head""Usage:$c_reset $c_cmd""jobrunner logs$c_reset $c_arg""$c_reset" >&2 return 1 end set -l name $argv[2] if not contains -- $name (__jobrunner_sessions $tool | string replace -r '\t.*$' '') - echo "$c_err""jobrunner:$c_rst no such job '$c_arg$name$c_rst'." >&2 + echo "$c_err""jobrunner:$c_reset no such job '$c_arg$name$c_reset'." >&2 return 1 end @@ -317,7 +317,7 @@ function jobrunner --description 'Manage detached background jobs with tmux or G # capture-pane -S - -p outputs the scrollback and current pane directly to stdout. set out (command tmux capture-pane -t $name -S - -p) or begin - echo "$c_err""jobrunner:$c_rst could not read output of '$c_arg$name$c_rst'." >&2 + echo "$c_err""jobrunner:$c_reset could not read output of '$c_arg$name$c_reset'." >&2 return 1 end else @@ -328,7 +328,7 @@ function jobrunner --description 'Manage detached background jobs with tmux or G command screen -X -S $name hardcopy -h $dump or begin command rm -f $dump - echo "$c_err""jobrunner:$c_rst could not read output of '$c_arg$name$c_rst'." >&2 + echo "$c_err""jobrunner:$c_reset could not read output of '$c_arg$name$c_reset'." >&2 return 1 end @@ -343,12 +343,12 @@ function jobrunner --description 'Manage detached background jobs with tmux or G if set -q out[1] printf '%s\n' $out else - echo "$c_dim(no output yet)$c_rst" + echo "$c_dim(no output yet)$c_reset" end case '*' - echo "$c_err""jobrunner:$c_rst invalid subcommand '$c_arg$cmd$c_rst'." >&2 - echo "Run $c_cmd""jobrunner --help$c_rst for usage." >&2 + echo "$c_err""jobrunner:$c_reset invalid subcommand '$c_arg$cmd$c_reset'." >&2 + echo "Run $c_cmd""jobrunner --help$c_reset for usage." >&2 return 1 end end diff --git a/functions/kitty-logging.fish b/functions/kitty-logging.fish index c9c1151..3ab50ae 100644 --- a/functions/kitty-logging.fish +++ b/functions/kitty-logging.fish @@ -39,7 +39,7 @@ # kitty-logging status function kitty-logging --description 'Install/manage the fish-config Kitty scrollback watcher' set -l c_head (set_color --bold cyan) - set -l c_cmd (set_color --bold white) + 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) diff --git a/functions/mkcd.fish b/functions/mkcd.fish index 24bd165..3a2eac9 100644 --- a/functions/mkcd.fish +++ b/functions/mkcd.fish @@ -27,7 +27,7 @@ # mkcd ~/projects/newapp/src function mkcd --description 'Create a directory (with parents) and cd into it' set -l c_head (set_color --bold cyan) - set -l c_cmd (set_color --bold white) + 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) diff --git a/functions/open-url.fish b/functions/open-url.fish index 66eb0ab..609e515 100644 --- a/functions/open-url.fish +++ b/functions/open-url.fish @@ -41,16 +41,24 @@ # 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) + argparse h/help s/silent v/verbose -- $argv or return 1 if set -q _flag_help - echo "Usage: open-url [-s|--silent] [-v|--verbose] " - echo "Open a URL or file:// URI in the best available web browser." + echo "$c_head""Usage:$c_reset $c_cmd""open-url$c_reset $c_flag""[-s|--silent] [-v|--verbose]$c_reset $c_arg""$c_reset" echo - echo " -s, --silent Suppress success output (the default)" - echo " -v, --verbose Print which browser is being launched" - echo " -h, --help Show this help" + echo " Open a URL or file:// URI in the best available web browser." + echo + echo "$c_head""Options:$c_reset" + echo " $c_flag-s$c_reset, $c_flag--silent$c_reset Suppress success output (the default)" + echo " $c_flag-v$c_reset, $c_flag--verbose$c_reset Print which browser is being launched" + echo " $c_flag-h$c_reset, $c_flag--help$c_reset Show this help" return 0 end diff --git a/functions/p.fish b/functions/p.fish index 0d83760..7a85cab 100644 --- a/functions/p.fish +++ b/functions/p.fish @@ -28,16 +28,20 @@ function p --description 'Put from clipboard' # Check for help flag if contains -- -h $argv; or contains -- --help $argv - echo "Usage: p [OPTIONS]" + 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) + echo "$c_head""Usage:$c_reset $c_cmd""p$c_reset $c_flag""[OPTIONS]$c_reset" echo "" - echo "Description:" echo " Pastes content from the system clipboard to stdout." echo "" - echo "Examples:" - echo " p Print clipboard content" - echo " p > file.txt Save clipboard to a file" - echo " p | grep 'foo' Pipe clipboard content to another command" - echo " cat (p) Use clipboard content as a filename for cat" + echo "$c_head""Examples:$c_reset" + echo " $c_cmd""p$c_reset "$c_dim"Print clipboard content"$c_reset + echo " $c_cmd""p$c_reset > file.txt "$c_dim"Save clipboard to a file"$c_reset + echo " $c_cmd""p$c_reset | grep 'foo' "$c_dim"Pipe clipboard content to another command"$c_reset + echo " cat ($c_cmd""p$c_reset) "$c_dim"Use clipboard content as a filename for cat"$c_reset return 0 end diff --git a/functions/pkg.fish b/functions/pkg.fish index 2b3f255..d7ba4c3 100644 --- a/functions/pkg.fish +++ b/functions/pkg.fish @@ -47,7 +47,7 @@ function pkg --description 'Install or remove packages via the system package ma # ── Colour palette ─────────────────────────────────────────── set -l c_head (set_color --bold cyan) - set -l c_cmd (set_color --bold white) + 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) diff --git a/functions/play-media.fish b/functions/play-media.fish index f6b6f03..1a81041 100644 --- a/functions/play-media.fish +++ b/functions/play-media.fish @@ -36,15 +36,23 @@ # 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) + argparse h/help p/player= -- $argv or return 1 if set -q _flag_help - echo "Usage: play-media [-p|--player ]" - echo "Pick audio/video files under the current directory with fzf and play them." + echo "$c_head""Usage:$c_reset $c_cmd""play-media$c_reset $c_flag""[-p|--player$c_reset $c_dim$c_reset""$c_flag]$c_reset" echo - echo " -p, --player Force a specific player command" - echo " -h, --help Show this help" + echo " Pick audio/video files under the current directory with fzf and play them." + echo + echo "$c_head""Options:$c_reset" + echo " $c_flag-p$c_reset, $c_flag--player$c_reset $c_dim$c_reset Force a specific player command" + echo " $c_flag-h$c_reset, $c_flag--help$c_reset Show this help" return 0 end diff --git a/functions/qc.fish b/functions/qc.fish index 5c8ed89..9cb8a55 100644 --- a/functions/qc.fish +++ b/functions/qc.fish @@ -33,7 +33,7 @@ if type -q aichat function qc --wraps aichat --description 'Quick-chat wrapper around aichat (cli role)' if contains -- -h $argv; or contains -- --help $argv set -l c_ttl (set_color --bold cyan) - set -l c_cmd (set_color --bold white) + set -l c_cmd (set_color --bold) set -l c_flag (set_color yellow) set -l c_txt (set_color normal) set -l c_dim (set_color brblack) diff --git a/functions/rand_string.fish b/functions/rand_string.fish index 7f4d588..b150c02 100644 --- a/functions/rand_string.fish +++ b/functions/rand_string.fish @@ -39,7 +39,7 @@ # much faster for files with >1000 lines. function rand_string --description 'Generate random, memorable strings from curated word databases' set -l c_head (set_color --bold cyan) - set -l c_cmd (set_color --bold white) + set -l c_cmd (set_color --bold) set -l c_arg (set_color cyan) set -l c_flag (set_color yellow) set -l c_rst (set_color normal) diff --git a/functions/replay.fish b/functions/replay.fish index cf529d9..6f29f12 100644 --- a/functions/replay.fish +++ b/functions/replay.fish @@ -27,10 +27,15 @@ function replay --description 'Run Bash commands replaying changes in Fish' case -v --version echo "replay, version 1.2.1" case "" -h --help - echo "Usage: replay Run Bash commands replaying changes in Fish" - echo "Options:" - echo " -v or --version Print version" - echo " -h or --help Print this help message" + 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) + echo "$c_head""Usage:$c_reset $c_cmd""replay$c_reset $c_arg""$c_reset Run Bash commands replaying changes in Fish" + echo "$c_head""Options:$c_reset" + echo " $c_flag-v$c_reset or $c_flag--version$c_reset Print version" + echo " $c_flag-h$c_reset or $c_flag--help$c_reset Print this help message" case \* set --local env set --local sep @$fish_pid(random)(command date +%s) diff --git a/functions/repo-open.fish b/functions/repo-open.fish index 9f5d3a8..9cb6b7e 100644 --- a/functions/repo-open.fish +++ b/functions/repo-open.fish @@ -52,17 +52,23 @@ # NOTES # Typo abbreviation: open-repo (expands to repo-open on space/enter). function repo-open --description 'Open the origin remote of the current repo in a 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_reset (set_color normal) + argparse -X 0 h/help p/print r/root -- $argv or return 1 if set -q _flag_help - echo "Usage: repo-open [-p|--print] [-r|--root]" - echo "Open the origin remote's web page for the current repo," - echo "deep-linking to the current branch and sub-directory." + echo "$c_head""Usage:$c_reset $c_cmd""repo-open$c_reset $c_flag""[-p|--print] [-r|--root]$c_reset" + echo " Open the origin remote's web page for the current repo," + echo " deep-linking to the current branch and sub-directory." echo - echo " -p, --print Print the URL instead of opening it" - echo " -r, --root Link to the repo root, ignoring the current sub-directory" - echo " -h, --help Show this help" + echo "$c_head""Options:$c_reset" + echo " $c_flag-p$c_reset, $c_flag--print$c_reset Print the URL instead of opening it" + echo " $c_flag-r$c_reset, $c_flag--root$c_reset Link to the repo root, ignoring the current sub-directory" + echo " $c_flag-h$c_reset, $c_flag--help$c_reset Show this help" return 0 end diff --git a/functions/scrub.fish b/functions/scrub.fish index 7ec50f0..cc15d3b 100644 --- a/functions/scrub.fish +++ b/functions/scrub.fish @@ -63,14 +63,19 @@ function scrub --description 'Recursively purge OS, editor, and compiler garbage # Helper function for help menu text function _scrub_help - echo (set_color --bold cyan)"Usage:"(set_color normal) "scrub [options]" + 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_reset (set_color normal) + + echo "$c_head""Usage:$c_reset $c_cmd""scrub$c_reset $c_flag""[options]$c_reset" echo - echo (set_color --bold cyan)"Options:"(set_color normal) - echo " -a, --aggressive Purge advanced development artifacts, logs, and heavyweight caches" - echo " -d, --dry-run Show files/folders that would be targeted without removing them" - echo " -h, --help Display this help menu" + echo "$c_head""Options:$c_reset" + echo " $c_flag-a$c_reset, $c_flag--aggressive$c_reset Purge advanced development artifacts, logs, and heavyweight caches" + echo " $c_flag-d$c_reset, $c_flag--dry-run$c_reset Show files/folders that would be targeted without removing them" + echo " $c_flag-h$c_reset, $c_flag--help$c_reset Display this help menu" echo - echo (set_color --bold cyan)"Standard Targets:"(set_color normal) + echo "$c_head""Standard Targets:$c_reset" echo " • OS Metadata: .DS_Store, ._* (AppleDouble), Thumbs.db, .directory (KDE)" echo " • Editors: *.swp, *.swo (Vim/Nvim), .netrwhist" echo " • Dev Caches: __pycache__, .pytest_cache, .turbo, *-debug.log" diff --git a/functions/spark.fish b/functions/spark.fish index 2a48ac1..19ddfad 100644 --- a/functions/spark.fish +++ b/functions/spark.fish @@ -29,16 +29,21 @@ function spark --description 'Sparklines' if set --query _flag_version[1] echo "spark, version 1.1.0" else if set --query _flag_help[1] - echo "Usage: spark " - echo " stdin | spark" - echo "Options:" - echo " --min= Minimum range" - echo " --max= Maximum range" - echo " -v or --version Print version" - echo " -h or --help Print this help message" - echo "Examples:" - echo " spark 1 1 2 5 14 42" - echo " seq 64 | sort --random-sort | spark" + 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) + echo "$c_head""Usage:$c_reset $c_cmd""spark$c_reset $c_arg""$c_reset" + echo " stdin | $c_cmd""spark$c_reset" + echo "$c_head""Options:$c_reset" + echo " $c_flag--min$c_reset""=$c_arg$c_reset Minimum range" + echo " $c_flag--max$c_reset""=$c_arg$c_reset Maximum range" + echo " $c_flag-v$c_reset or $c_flag--version$c_reset Print version" + echo " $c_flag-h$c_reset or $c_flag--help$c_reset Print this help message" + echo "$c_head""Examples:$c_reset" + echo " $c_cmd""spark$c_reset 1 1 2 5 14 42" + echo " seq 64 | sort --random-sort | $c_cmd""spark$c_reset" else if set --query argv[1] printf "%s\n" $argv | spark --min="$_flag_min" --max="$_flag_max" else diff --git a/functions/wake-lock.fish b/functions/wake-lock.fish index 7fdd018..053556e 100644 --- a/functions/wake-lock.fish +++ b/functions/wake-lock.fish @@ -23,7 +23,11 @@ # wake-lock rsync -avz src/ dest/ function wake-lock --description 'Run a command while inhibiting system sleep' if test (count $argv) -eq 0 - echo "Usage: wake-lock [command] [args...]" + 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) + echo "$c_head""Usage:$c_reset $c_cmd""wake-lock$c_reset $c_arg""[command] [args...]$c_reset" return 1 end diff --git a/functions/y.fish b/functions/y.fish index 10444f9..5bac53d 100644 --- a/functions/y.fish +++ b/functions/y.fish @@ -25,13 +25,18 @@ function y --description 'Yank to clipboard' # Check for help flag if contains -- -h $argv; or contains -- --help $argv - echo "Usage: y [TEXT] or [COMMAND] | y" + 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_dim (set_color brblack) + set -l c_reset (set_color normal) + echo "$c_head""Usage:$c_reset $c_cmd""y$c_reset $c_arg""[TEXT]$c_reset or $c_arg""[COMMAND]$c_reset | $c_cmd""y$c_reset" echo "" - echo "Examples:" - echo " y \"hello world\" Copy a string directly" - echo " ls | y Copy output of a command" - echo " y < file.txt Copy contents of a file" - echo " cat file.txt | y Another way to copy a file" + echo "$c_head""Examples:$c_reset" + echo " $c_cmd""y$c_reset \"hello world\" "$c_dim"Copy a string directly"$c_reset + echo " ls | $c_cmd""y$c_reset "$c_dim"Copy output of a command"$c_reset + echo " $c_cmd""y$c_reset < file.txt "$c_dim"Copy contents of a file"$c_reset + echo " cat file.txt | $c_cmd""y$c_reset "$c_dim"Another way to copy a file"$c_reset return 0 end