chore(zsh/completion): improve completion setup for various commands

This commit is contained in:
2024-02-22 23:52:26 +00:00
parent 6cd1d787c7
commit 65544c24cc
4 changed files with 41 additions and 45 deletions

View File

@@ -32,19 +32,5 @@ fi
if command-exists orb; then
alias oc="orb"
_setup-orb-completion() {
local target
target="${ZSH_COMPLETIONS}/_orb"
if [ ! -f "$target" ] || [ "$target" -ot "$(command -v orb)" ]; then
echo "Setting up completion for orb -- $target"
mkdir -p "$(dirname "$target")"
orb completion zsh > "$target"
chmod +x "$target"
autoload -U compinit && compinit
fi
}
_setup-orb-completion
setup-completions orb "$(command -v orb)" orb completion zsh
fi