feat(help): standardize colored --help output across functions

Add the established c_head/c_cmd/c_flag/c_dim/c_arg color scheme to
--help (or usage-on-error) output in play-media and 13 other functions
that lacked it or used an ad hoc scheme: bkg, detach, replay, p, y,
spark, wake-lock, open-url, repo-open, dng2avif, dockup, fish-deps
(__fish_deps_help), and scrub.

Also tweak the standard itself:
- c_cmd now uses plain `set_color --bold` instead of `--bold white`,
  so the command name adapts to the terminal's foreground instead of
  forcing white text that washes out on light-background themes.
  Applied across all functions already using the pattern.
- jobrunner's reset variable renamed from c_rst to c_reset to match
  the naming used everywhere else.
This commit is contained in:
2026-08-22 00:19:43 -04:00
parent 4006a2f855
commit 500dd8a735
25 changed files with 214 additions and 138 deletions
+11 -7
View File
@@ -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