mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-12-03 21:58:56 +01:00
Co-authored-by: Robby Russell <robby@planetargon.com> Signed-off-by: Jonathan Stacks <jonstacks@users.noreply.github.com>
18 lines
565 B
Bash
18 lines
565 B
Bash
# Autocompletion for sprite
|
|
if (( ! $+commands[sprite] )); then
|
|
return
|
|
fi
|
|
|
|
# If the completion file doesn't exist yet, we need to autoload it and
|
|
# bind it to `sprite`. Otherwise, compinit will have already done that.
|
|
if [[ ! -f "$ZSH_CACHE_DIR/completions/_sprite" ]]; then
|
|
typeset -g -A _comps
|
|
autoload -Uz _sprite
|
|
_comps[sprite]=_sprite
|
|
fi
|
|
|
|
() {
|
|
local tmpfile="$ZSH_CACHE_DIR/completions/_sprite.$$.tmp"
|
|
sprite completion zsh >| "$tmpfile" 2>/dev/null && command mv -f "$tmpfile" "$ZSH_CACHE_DIR/completions/_sprite" || command rm -f "$tmpfile"
|
|
} &|
|