mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-14 01:40:09 +00:00
11 lines
416 B
Bash
11 lines
416 B
Bash
# COMPLETION FUNCTION
|
|
if (( $+commands[rustup] && $+commands[cargo] )); then
|
|
if [[ ! -f $ZSH_CACHE_DIR/cargo_version ]] \
|
|
|| [[ "$(cargo --version)" != "$(< "$ZSH_CACHE_DIR/cargo_version")" ]] \
|
|
|| [[ ! -f $ZSH/plugins/cargo/_cargo ]]; then
|
|
rustup completions zsh cargo > $ZSH/plugins/cargo/_cargo
|
|
cargo --version > $ZSH_CACHE_DIR/cargo_version
|
|
fi
|
|
autoload -Uz _cargo
|
|
_comps[cargo]=_cargo
|
|
fi
|