refactor(path): consolidate x-path-{append,prepend,remove} as thin wrappers

Add source guard to x-path so its functions can be loaded without
executing the main logic. Rewrite standalone path scripts to source
x-path and call the appropriate function directly, eliminating code
duplication while preserving source-ability for shell integration.
This commit is contained in:
2026-02-05 20:51:52 +02:00
parent 4414e0c3b6
commit fc8db1f5b5
4 changed files with 21 additions and 102 deletions

View File

@@ -227,6 +227,9 @@ do_check()
fi
}
# If sourced, provide functions without executing main logic
(return 0 2> /dev/null) && return
#######################################
# Main routine: Parse subcommand and arguments, normalize PATH,
# and dispatch to the appropriate functionality.