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
1
plugins/rustup/.gitignore
vendored
Normal file
1
plugins/rustup/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
_rustup
|
||||
File diff suppressed because it is too large
Load diff
12
plugins/rustup/rustup.plugin.zsh
Normal file
12
plugins/rustup/rustup.plugin.zsh
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue