codex.plugin.zsh
428 bytes
1# COMPLETION FUNCTION
2if (( ! $+commands[codex] )); then
3 return
4fi
5
6# If the completion file doesn't exist yet, we need to autoload it and
7# bind it to `codex`. Otherwise, compinit will have already done that.
8if [[ ! -f "$ZSH_CACHE_DIR/completions/_codex" ]]; then
9 typeset -g -A _comps
10 autoload -Uz _codex
11 _comps[codex]=_codex
12fi
13
14codex completion zsh < /dev/null 2> /dev/null >| "$ZSH_CACHE_DIR/completions/_codex" &|