Unverified Commit 450acc01 authored by Carlo Sala's avatar Carlo Sala Committed by GitHub

fix: automatically create completion for `cargo` and `rustup` plugins (#10087)

parent 37a60eeb
_cargo
This diff is collapsed.
# 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
_rustup
This diff is collapsed.
# COMPLETION FUNCTION
if (( $+commands[rustup] )); then
if [[ ! -f $ZSH_CACHE_DIR/rustup_version ]] \
|| [[ "$(rustup --version 2> /dev/null)" \
!= "$(< "$ZSH_CACHE_DIR/rustup_version")" ]] \
|| [[ ! -f $ZSH/plugins/rustup/_rustup ]]; then
rustup completions zsh > $ZSH/plugins/rustup/_rustup
rustup --version 2> /dev/null > $ZSH_CACHE_DIR/rustup_version
fi
autoload -Uz _rustup
_comps[rustup]=_rustup
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment