1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-14 01:40:09 +00:00
ohmyzsh/plugins/cargo/cargo.plugin.zsh

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