feat(guards): per-category variable overrides master in __fish_config_op_enabled #41

Merged
rootiest merged 5 commits from feat/per-category-master-override into main 2026-06-11 03:09:52 +00:00
Owner

Summary

  • Changes __fish_config_op_enabled evaluation order: category variable is checked first; the master switch __fish_config_opinionated is only consulted when the category variable is unset or unrecognized
  • An explicit per-category truthy value (e.g. set -U __fish_config_op_greeting 1) now enables that category even when __fish_config_opinionated=0 — previously the falsy master unconditionally blocked all categories
  • Updates DESCRIPTION and RETURNS docblock in the function file; documents the new precedence in README and docs/fish-config.md

Behavior change

Category var Master Before After
unset falsy disabled disabled (unchanged)
explicitly truthy falsy disabled enabled (new)
explicitly falsy truthy disabled disabled (unchanged)
unset unset enabled enabled (unchanged)

Manual Verification

  • In a new fish shell, confirm default behavior is unchanged: erase both variables (set -Ue __fish_config_opinionated; set -Ue __fish_config_op_greeting), open a new shell — greeting and all opinionated components should be active
  • Confirm master disable still works: set -U __fish_config_opinionated 0 → open a new shell → no greeting, no command shadows (ls should not use eza)
  • Confirm per-category override: set -U __fish_config_opinionated 0; set -U __fish_config_op_greeting 1 → open a new shell → greeting runs but command shadows are still suppressed
  • Confirm explicit category falsy still disables: set -Ue __fish_config_opinionated; set -U __fish_config_op_greeting 0 → open a new shell → greeting is suppressed, all other categories active
  • Clean up test variables: set -Ue __fish_config_opinionated; set -Ue __fish_config_op_greeting
## Summary - Changes `__fish_config_op_enabled` evaluation order: category variable is checked **first**; the master switch `__fish_config_opinionated` is only consulted when the category variable is unset or unrecognized - An explicit per-category truthy value (e.g. `set -U __fish_config_op_greeting 1`) now enables that category even when `__fish_config_opinionated=0` — previously the falsy master unconditionally blocked all categories - Updates DESCRIPTION and RETURNS docblock in the function file; documents the new precedence in README and `docs/fish-config.md` ## Behavior change | Category var | Master | Before | After | |---|---|---|---| | unset | falsy | disabled | disabled (unchanged) | | explicitly truthy | falsy | **disabled** | **enabled** (new) | | explicitly falsy | truthy | disabled | disabled (unchanged) | | unset | unset | enabled | enabled (unchanged) | ## Manual Verification - [x] In a new fish shell, confirm default behavior is unchanged: erase both variables (`set -Ue __fish_config_opinionated; set -Ue __fish_config_op_greeting`), open a new shell — greeting and all opinionated components should be active - [x] Confirm master disable still works: `set -U __fish_config_opinionated 0` → open a new shell → no greeting, no command shadows (`ls` should not use eza) - [x] Confirm per-category override: `set -U __fish_config_opinionated 0; set -U __fish_config_op_greeting 1` → open a new shell → greeting runs but command shadows are still suppressed - [x] Confirm explicit category falsy still disables: `set -Ue __fish_config_opinionated; set -U __fish_config_op_greeting 0` → open a new shell → greeting is suppressed, all other categories active - [x] Clean up test variables: `set -Ue __fish_config_opinionated; set -Ue __fish_config_op_greeting`
rootiest added 5 commits 2026-06-11 03:07:53 +00:00
rootiest merged commit 4bef8f9c91 into main 2026-06-11 03:09:52 +00:00
rootiest deleted branch feat/per-category-master-override 2026-06-11 03:09:52 +00:00
Sign in to join this conversation.