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
+12 -7
View File
@@ -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