mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-05 01:46:46 +01:00
fix: automatically create completion for cargo and rustup plugins (#10087)
This commit is contained in:
parent
37a60eebc1
commit
450acc0113
6 changed files with 25 additions and 1550 deletions
11
plugins/cargo/cargo.plugin.zsh
Normal file
11
plugins/cargo/cargo.plugin.zsh
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue