From 04fd83297429144d7273f8aae0a12ca99a715513 Mon Sep 17 00:00:00 2001 From: Rootiest Date: Mon, 17 Aug 2026 21:12:56 -0400 Subject: [PATCH] refactor(config): migrate C1 aliases call sites to self-identifying guard --- conf.d/__fish_config_op_registry.fish | 48 +++++++++++++++++++++++++++ conf.d/help.fish | 5 ++- conf.d/zoxide.fish | 5 ++- functions/agy.fish | 5 ++- functions/bash.fish | 5 ++- functions/cat.fish | 5 ++- functions/claude.fish | 5 ++- functions/du.fish | 5 ++- functions/edit.fish | 5 ++- functions/less.fish | 5 ++- functions/ls.fish | 5 ++- functions/mkdir.fish | 5 ++- functions/mv.fish | 5 ++- functions/ping.fish | 5 ++- functions/rg.fish | 5 ++- functions/rm.fish | 5 ++- functions/ssh.fish | 5 ++- functions/top.fish | 5 ++- functions/yt-dlp.fish | 5 ++- 19 files changed, 120 insertions(+), 18 deletions(-) create mode 100644 conf.d/__fish_config_op_registry.fish diff --git a/conf.d/__fish_config_op_registry.fish b/conf.d/__fish_config_op_registry.fish new file mode 100644 index 0000000..df89810 --- /dev/null +++ b/conf.d/__fish_config_op_registry.fish @@ -0,0 +1,48 @@ +# Copyright (C) 2026 Rootiest +# SPDX-License-Identifier: AGPL-3.0-or-later +# +# GENERATED FILE --- do not edit by hand. +# Regenerate with __fish_config_op_registry_rebuild after editing a +# # COMPONENT header, or automatically via docs/build-manual.py. +# Source: docs/generate_component_registry.py + +set -g __fish_config_op_registry_keys \ + agy: \ + bash: \ + cat: \ + claude: \ + du: \ + edit: \ + help: \ + less: \ + ls: \ + mkdir: \ + mv: \ + ping: \ + rg: \ + rm: \ + ssh: \ + top: \ + yt-dlp: \ + zoxide: + +set -g __fish_config_op_registry_values \ + "aliases/dev-tools" \ + "aliases/shell-tools" \ + "aliases/filesystem" \ + "aliases/dev-tools" \ + "aliases/filesystem" \ + "aliases/dev-tools" \ + "aliases/shell-tools" \ + "aliases/shell-tools" \ + "aliases/filesystem" \ + "aliases/filesystem" \ + "aliases/filesystem" \ + "aliases/network" \ + "aliases/search" \ + "aliases/filesystem" \ + "aliases/network" \ + "aliases/monitor" \ + "aliases/network" \ + "aliases/filesystem" + diff --git a/conf.d/help.fish b/conf.d/help.fish index ecca847..0e7e3e5 100644 --- a/conf.d/help.fish +++ b/conf.d/help.fish @@ -5,6 +5,9 @@ # │ help config wrapper │ # ╰──────────────────────────────────────────────────────────╯ # +# COMPONENT +# aliases/shell-tools +# # SYNOPSIS # help [topic] [sub-topic...] # help config [section] [-w|--html] [-m|--man] [-h|--help] @@ -50,7 +53,7 @@ end # --- Wrapper Definition --- function help --wraps help --description "Custom wrapper to intercept 'help config'" # Opinionated guard (C1): fall back to the native fish help when disabled. - if not __fish_config_op_enabled __fish_config_op_aliases + if not __fish_config_op_enabled (status current-function) __original_help $argv return $status end diff --git a/conf.d/zoxide.fish b/conf.d/zoxide.fish index 57a6efe..5d2319c 100644 --- a/conf.d/zoxide.fish +++ b/conf.d/zoxide.fish @@ -3,6 +3,9 @@ # Adapted from icezyclon/zoxide.fish (MIT) # Heavily customized for Fish 4.x compatibility and performance +# COMPONENT +# aliases/filesystem + if status is-interactive if type -q zoxide @@ -65,7 +68,7 @@ if status is-interactive # Shadowing cd with zoxide is opinionated (C1 aliasing); z and zi # remain available either way. - if __fish_config_op_enabled __fish_config_op_aliases + if __fish_config_op_enabled (status basename) alias cd=z end diff --git a/functions/agy.fish b/functions/agy.fish index 21aed74..cfc751d 100644 --- a/functions/agy.fish +++ b/functions/agy.fish @@ -4,6 +4,9 @@ # CATEGORY # 12-ai-and-developer-tools # +# COMPONENT +# aliases/dev-tools +# # DEPENDENCIES # agents-init # @@ -35,7 +38,7 @@ # agy -i "initial prompt" # agy models function agy --wraps=agy --description 'agy wrapper: auto-initializes AGENTS/ sub-repo before launch' - if not __fish_config_op_enabled __fish_config_op_aliases + if not __fish_config_op_enabled (status current-function) command agy $argv return $status end diff --git a/functions/bash.fish b/functions/bash.fish index 39cbd93..bfb721e 100644 --- a/functions/bash.fish +++ b/functions/bash.fish @@ -4,6 +4,9 @@ # CATEGORY # 14-miscellaneous # +# COMPONENT +# aliases/shell-tools +# # SYNOPSIS # bash [args...] # @@ -18,7 +21,7 @@ # bash function bash --wraps='bash' --description 'bash switches to bash shell' # Opinionated guard (C1): fall back to bare command bash when disabled. - if not __fish_config_op_enabled __fish_config_op_aliases + if not __fish_config_op_enabled (status current-function) command bash $argv return $status end diff --git a/functions/cat.fish b/functions/cat.fish index 76049a6..e6394b8 100644 --- a/functions/cat.fish +++ b/functions/cat.fish @@ -4,6 +4,9 @@ # CATEGORY # 01-file-and-directory # +# COMPONENT +# aliases/filesystem +# # SYNOPSIS # cat [args...] # @@ -21,7 +24,7 @@ # cat ~/projects/myapp function cat --wraps='bat' --description 'Use bat for files, ls for directories, and raw cat for ANSI logs' # Opinionated guard (C1): fall back to bare command cat when disabled. - if not __fish_config_op_enabled __fish_config_op_aliases + if not __fish_config_op_enabled (status current-function) command cat $argv return $status end diff --git a/functions/claude.fish b/functions/claude.fish index 3b981d7..ff3d278 100644 --- a/functions/claude.fish +++ b/functions/claude.fish @@ -4,6 +4,9 @@ # CATEGORY # 12-ai-and-developer-tools # +# COMPONENT +# aliases/dev-tools +# # DEPENDENCIES # agents-init # @@ -33,7 +36,7 @@ # claude --resume # claude "Explain the recent changes" function claude --wraps=claude --description 'claude wrapper: auto-links AGENTS.md as CLAUDE.md' - if not __fish_config_op_enabled __fish_config_op_aliases + if not __fish_config_op_enabled (status current-function) command claude $argv return $status end diff --git a/functions/du.fish b/functions/du.fish index 6fd4f93..ad03503 100644 --- a/functions/du.fish +++ b/functions/du.fish @@ -4,6 +4,9 @@ # CATEGORY # 01-file-and-directory # +# COMPONENT +# aliases/filesystem +# # SYNOPSIS # du [--disk|--dir|--dua] [args...] # @@ -23,7 +26,7 @@ # du --disk function du --description 'Execute du' # Opinionated guard (C1): fall back to bare command du when disabled. - if not __fish_config_op_enabled __fish_config_op_aliases + if not __fish_config_op_enabled (status current-function) command du $argv return $status end diff --git a/functions/edit.fish b/functions/edit.fish index b02e3ab..ed178b4 100644 --- a/functions/edit.fish +++ b/functions/edit.fish @@ -4,6 +4,9 @@ # CATEGORY # 03-editors-and-viewers # +# COMPONENT +# aliases/dev-tools +# # SYNOPSIS # edit [-V|-t] [-e EDITOR] [-c] [-x TEXT] [-n] [-v|-s] [FILE...] # @@ -50,7 +53,7 @@ function edit --description 'Open files in a terminal or GUI editor with fallbac set -l c_reset (set_color normal) # Opinionated guard (C1): fall back to the legacy bare-editor behavior. - if not __fish_config_op_enabled __fish_config_op_aliases + if not __fish_config_op_enabled (status current-function) if set -q EDITOR; and test -n "$EDITOR" $EDITOR $argv else if type -q nvim diff --git a/functions/less.fish b/functions/less.fish index f60bdc5..11c034e 100644 --- a/functions/less.fish +++ b/functions/less.fish @@ -4,6 +4,9 @@ # CATEGORY # 03-editors-and-viewers # +# COMPONENT +# aliases/shell-tools +# # SYNOPSIS # less [args...] # @@ -18,7 +21,7 @@ # less /var/log/syslog function less --wraps='ov' --description 'Pager wrapper: $PAGER → ov → less → more → cat' # Opinionated guard (C1): fall back to bare command less when disabled. - if not __fish_config_op_enabled __fish_config_op_aliases + if not __fish_config_op_enabled (status current-function) command less $argv return $status end diff --git a/functions/ls.fish b/functions/ls.fish index a094d4d..da11956 100644 --- a/functions/ls.fish +++ b/functions/ls.fish @@ -4,6 +4,9 @@ # CATEGORY # 01-file-and-directory # +# COMPONENT +# aliases/filesystem +# # SYNOPSIS # ls [args...] # @@ -20,7 +23,7 @@ # ls -a ~/projects function ls --description 'List all files' # Opinionated guard (C1): fall back to bare command ls when disabled. - if not __fish_config_op_enabled __fish_config_op_aliases + if not __fish_config_op_enabled (status current-function) command ls $argv return $status end diff --git a/functions/mkdir.fish b/functions/mkdir.fish index bb45658..cf013d6 100644 --- a/functions/mkdir.fish +++ b/functions/mkdir.fish @@ -4,6 +4,9 @@ # CATEGORY # 01-file-and-directory # +# COMPONENT +# aliases/filesystem +# # SYNOPSIS # mkdir [args...] # @@ -20,7 +23,7 @@ # mkdir ~/projects/myapp/src function mkdir --description 'Execute mkdir' # Opinionated guard (C1): fall back to bare command mkdir when disabled. - if not __fish_config_op_enabled __fish_config_op_aliases + if not __fish_config_op_enabled (status current-function) command mkdir $argv return $status end diff --git a/functions/mv.fish b/functions/mv.fish index d8ea113..e8e4b8b 100644 --- a/functions/mv.fish +++ b/functions/mv.fish @@ -4,6 +4,9 @@ # CATEGORY # 01-file-and-directory # +# COMPONENT +# aliases/filesystem +# # SYNOPSIS # mv [args...] # @@ -27,7 +30,7 @@ # mv ~/.config/btop/themes/themes ~/.config/btop/themes function mv --wraps='mv' --description 'Move files with auto-collapse for nested directories' # Opinionated guard (C1): fall back to bare command mv when disabled. - if not __fish_config_op_enabled __fish_config_op_aliases + if not __fish_config_op_enabled (status current-function) command mv $argv return $status end diff --git a/functions/ping.fish b/functions/ping.fish index ca9fd62..947d597 100644 --- a/functions/ping.fish +++ b/functions/ping.fish @@ -4,6 +4,9 @@ # CATEGORY # 10-network # +# COMPONENT +# aliases/network +# # SYNOPSIS # ping [args...] # @@ -21,7 +24,7 @@ # ping --legend google.com function ping --description 'prettyping with default nolegend' # Opinionated guard (C1): fall back to bare command ping when disabled. - if not __fish_config_op_enabled __fish_config_op_aliases + if not __fish_config_op_enabled (status current-function) command ping $argv return $status end diff --git a/functions/rg.fish b/functions/rg.fish index 346f652..0c164cb 100644 --- a/functions/rg.fish +++ b/functions/rg.fish @@ -4,6 +4,9 @@ # CATEGORY # 01-file-and-directory # +# COMPONENT +# aliases/search +# # SYNOPSIS # rg [args...] # @@ -21,7 +24,7 @@ # rg -l "TODO" ~/projects/myapp function rg --description 'alias rg=rg --hyperlink-format=kitty' # Opinionated guard (C1): fall back to bare command rg when disabled. - if not __fish_config_op_enabled __fish_config_op_aliases + if not __fish_config_op_enabled (status current-function) command rg $argv return $status end diff --git a/functions/rm.fish b/functions/rm.fish index 965e0e8..bbcd46c 100644 --- a/functions/rm.fish +++ b/functions/rm.fish @@ -4,6 +4,9 @@ # CATEGORY # 01-file-and-directory # +# COMPONENT +# aliases/filesystem +# # SYNOPSIS # rm [-e [options] | -S | args...] # @@ -38,7 +41,7 @@ # Falls back to /usr/bin/rm when trash is unavailable. function rm --description 'Ultimate rm: trash, list, empty, and secure-erase' # Opinionated guard (C1): fall back to bare command rm when disabled. - if not __fish_config_op_enabled __fish_config_op_aliases + if not __fish_config_op_enabled (status current-function) command rm $argv return $status end diff --git a/functions/ssh.fish b/functions/ssh.fish index 4814277..162432f 100644 --- a/functions/ssh.fish +++ b/functions/ssh.fish @@ -4,6 +4,9 @@ # CATEGORY # 08-terminal-management # +# COMPONENT +# aliases/network +# # SYNOPSIS # ssh [args...] # @@ -20,7 +23,7 @@ # ssh user@host function ssh --description 'Alias ssh to kitten ssh when using Kitty terminal' # Opinionated guard (C1): fall back to bare command ssh when disabled. - if not __fish_config_op_enabled __fish_config_op_aliases + if not __fish_config_op_enabled (status current-function) command ssh $argv return $status end diff --git a/functions/top.fish b/functions/top.fish index b765586..73c77df 100644 --- a/functions/top.fish +++ b/functions/top.fish @@ -4,6 +4,9 @@ # CATEGORY # 07-system-and-monitoring # +# COMPONENT +# aliases/monitor +# # SYNOPSIS # top [args...] # @@ -18,7 +21,7 @@ # top function top --wraps='btop' --description 'Use btop as a modern replacement for top' # Opinionated guard (C1): fall back to bare command top when disabled. - if not __fish_config_op_enabled __fish_config_op_aliases + if not __fish_config_op_enabled (status current-function) command top $argv return $status end diff --git a/functions/yt-dlp.fish b/functions/yt-dlp.fish index 3ce96fb..da8c317 100644 --- a/functions/yt-dlp.fish +++ b/functions/yt-dlp.fish @@ -4,6 +4,9 @@ # CATEGORY # 13-media-and-utilities # +# COMPONENT +# aliases/network +# # SYNOPSIS # yt-dlp [args...] URL [URL...] # @@ -29,7 +32,7 @@ # yt-dlp --no-embed-thumbnail dQw4w9WgXcQ # drops our thumbnail default function yt-dlp --description 'yt-dlp with embedding + SponsorBlock defaults' # Opinionated guard (C1): fall back to bare command yt-dlp when disabled. - if not __fish_config_op_enabled __fish_config_op_aliases + if not __fish_config_op_enabled (status current-function) command yt-dlp $argv return $status end