From d2e07effc1fb04ff3f4f6cfb0aa4f4491c98a256 Mon Sep 17 00:00:00 2001 From: Rootiest Date: Mon, 17 Aug 2026 20:46:55 -0400 Subject: [PATCH] feat(config): add manual registry-rebuild command --- .../__fish_config_op_registry_rebuild.fish | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 functions/__fish_config_op_registry_rebuild.fish diff --git a/functions/__fish_config_op_registry_rebuild.fish b/functions/__fish_config_op_registry_rebuild.fish new file mode 100644 index 0000000..d9c7f9f --- /dev/null +++ b/functions/__fish_config_op_registry_rebuild.fish @@ -0,0 +1,30 @@ +# Copyright (C) 2026 Rootiest +# SPDX-License-Identifier: AGPL-3.0-or-later + +# SYNOPSIS +# __fish_config_op_registry_rebuild +# +# DESCRIPTION +# Regenerates conf.d/__fish_config_op_registry.fish from every +# # COMPONENT header in functions/*.fish, conf.d/*.fish, and +# config.fish, then re-sources it into the current session so the +# change takes effect immediately. Run manually after editing a +# # COMPONENT header; never run automatically at shell startup -- +# parsing every header on every new shell would be wasted work on +# every session that isn't actively editing a header. +# +# EXIT STATUS +# 0 Registry regenerated +# 1 python3 is not available, or generation failed +# +# EXAMPLE +# __fish_config_op_registry_rebuild +function __fish_config_op_registry_rebuild --description 'Regenerate the opinionated-component registry from # COMPONENT headers' + if not type -q python3 + echo "__fish_config_op_registry_rebuild: python3 not found" >&2 + return 1 + end + python3 "$__fish_config_dir/docs/generate_component_registry.py" + or return 1 + source "$__fish_config_dir/conf.d/__fish_config_op_registry.fish" +end