mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-28 17:28:56 +01:00
12 lines
416 B
Bash
12 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
|