refactor: retire drifted palette names in the last five functions
c_rst/c_txt -> c_reset, c_ttl -> c_head, c_bold -> c_cmd, c_primary -> c_arg across 67 interpolation sites (c_rst 53, c_primary 10, c_bold 2, c_ttl 1, c_txt 1). Each maps to a variable holding identical bytes, so output is unchanged. Unlike the 33 structural conversions this edits text that renders, so it is gated on its own per-file byte-diff against main: ok logs --help (431 B out, 0 B err) ok mkcd --help (437 B out, 0 B err) ok qc --help (936 B out, 0 B err) ok rand_string --help (883 B out, 0 B err) ok smart_exit --help (265 B out, 0 B err) ok mkcd (437 B out, 0 B err) <- no-args error path c_accent is deliberately NOT merged into c_ok -- both are (set_color green) but a role is a semantic slot, not a colour. See JOB-BRIEF-FINDINGS.md. logs.fish needed two calls (the C4 guard block and the --help block, both at 8-space indentation); it is the only multi-run file in the repository and the exact trap a depth-deduplicating converter falls into. logs.fish also declared c_bold without ever interpolating it -- that declaration is simply deleted.
This commit is contained in:
+14
-18
@@ -38,31 +38,27 @@
|
||||
# Falls back to random choice if GNU shuf is missing, but shuf is
|
||||
# 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)
|
||||
set -l c_arg (set_color cyan)
|
||||
set -l c_flag (set_color yellow)
|
||||
set -l c_rst (set_color normal)
|
||||
__fish_palette
|
||||
|
||||
if set -q argv[1]; and contains -- $argv[1] -h --help
|
||||
echo "$c_head""Usage:$c_rst $c_cmd""rand_string$c_rst $c_arg""[COMPONENTS/MODIFIERS]...$c_rst"
|
||||
echo "$c_head""Usage:$c_reset $c_cmd""rand_string$c_reset $c_arg""[COMPONENTS/MODIFIERS]...$c_reset"
|
||||
echo
|
||||
echo " Generate random, memorable strings from curated word databases."
|
||||
echo
|
||||
echo "$c_head""Components:$c_rst"
|
||||
echo " $c_arg<category>$c_rst A bundled word list (e.g. adjective, animal, color, name, noun, verb)"
|
||||
echo " $c_arg""digits=<N>$c_rst N random digits (e.g. digits=3 -> 842)"
|
||||
echo " $c_arg""literal=<text>$c_rst A static string component for prefixes/suffixes (e.g. literal=TEST)"
|
||||
echo "$c_head""Components:$c_reset"
|
||||
echo " $c_arg<category>$c_reset A bundled word list (e.g. adjective, animal, color, name, noun, verb)"
|
||||
echo " $c_arg""digits=<N>$c_reset N random digits (e.g. digits=3 -> 842)"
|
||||
echo " $c_arg""literal=<text>$c_reset A static string component for prefixes/suffixes (e.g. literal=TEST)"
|
||||
echo
|
||||
echo "$c_head""Modifiers:$c_rst"
|
||||
echo " $c_flag-s$c_rst, $c_flag--separator=<sep>$c_rst Delimiter for subsequent words (dash, underscore, dot, none)"
|
||||
echo " $c_flag-c$c_rst, $c_flag--case=<casing>$c_rst Casing for subsequent words (lower, upper, title)"
|
||||
echo " $c_flag-h$c_rst, $c_flag--help$c_rst Show usage help"
|
||||
echo "$c_head""Modifiers:$c_reset"
|
||||
echo " $c_flag-s$c_reset, $c_flag--separator=<sep>$c_reset Delimiter for subsequent words (dash, underscore, dot, none)"
|
||||
echo " $c_flag-c$c_reset, $c_flag--case=<casing>$c_reset Casing for subsequent words (lower, upper, title)"
|
||||
echo " $c_flag-h$c_reset, $c_flag--help$c_reset Show usage help"
|
||||
echo
|
||||
echo "$c_head""Examples:$c_rst"
|
||||
echo " $c_cmd""rand_string$c_rst adjective animal"
|
||||
echo " $c_cmd""rand_string$c_rst --case=title color animal --separator=dot digits=4"
|
||||
echo " $c_cmd""rand_string$c_rst literal=TEST --separator=underscore verb noun"
|
||||
echo "$c_head""Examples:$c_reset"
|
||||
echo " $c_cmd""rand_string$c_reset adjective animal"
|
||||
echo " $c_cmd""rand_string$c_reset --case=title color animal --separator=dot digits=4"
|
||||
echo " $c_cmd""rand_string$c_reset literal=TEST --separator=underscore verb noun"
|
||||
return 0
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user