refactor: use __fish_palette in agents and auto-pull functions

34 duplicated declarations replaced by 5 calls. Output strings untouched;
byte-identical across 29 harness cases.
This commit is contained in:
2026-09-07 20:02:15 -04:00
parent bca79d3c5a
commit e64e964666
5 changed files with 5 additions and 34 deletions
+1 -2
View File
@@ -31,8 +31,7 @@
# EXAMPLE
# _agents_init_ensure_gitignore /home/user/myproject "agents-init" "AGENTS/" "/AGENTS.md"
function _agents_init_ensure_gitignore
set -l c_ok (set_color green)
set -l c_reset (set_color normal)
__fish_palette
if test (count $argv) -lt 3
echo (set_color red)"_agents_init_ensure_gitignore: requires <root> <label> <pattern>..."(set_color normal) >&2
+1 -8
View File
@@ -85,14 +85,7 @@
# agents-init --plugins
# 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)
set -l c_flag (set_color yellow)
set -l c_ok (set_color green)
set -l c_warn (set_color yellow)
set -l c_dim (set_color brblack)
set -l c_err (set_color red)
set -l c_reset (set_color normal)
__fish_palette
argparse h/help a/agents p/plugins v/verbose q/quiet s/silent -- $argv
or return 1
+1 -8
View File
@@ -186,14 +186,7 @@
# throwaway directory and leave a dangling symlink behind, which is
# strictly worse than having had no backup at all.
function agents-vault --description 'track curated agent memory in a host-scoped vault repo'
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_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)
__fish_palette
argparse h/help link push restore status 'adopt=' 'remote=' \
v/verbose q/quiet s/silent -- $argv
+1 -8
View File
@@ -42,14 +42,7 @@
# auto-pull list
# 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)
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)
__fish_palette
set -q __fish_config_dir; or set -l __fish_config_dir $XDG_CONFIG_HOME/fish
set -q __fish_user_dots_path; or set -l __fish_user_dots_path "$XDG_CONFIG_HOME/.user-dots/fish"
+1 -8
View File
@@ -27,14 +27,7 @@
# config-update --dry-run
# 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)
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)
__fish_palette
set -l REMOTE_URL https://git.rootiest.dev/rootiest/fish-config.git
set -l CONFIG_DIR ~/.config/fish