diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2021-09-10 20:10:26 -0600 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2021-09-10 20:10:26 -0600 |
commit | 3c73976ef306d68a85d60c94be9a1dcdc33fa2bf (patch) | |
tree | 619ba4b5874b92ada9dc089c67a435dd3149748a /plugins/rustup/rustup.plugin.zsh | |
parent | f8b7b6584bf1ca7e836ba9cc13fcce573047fb07 (diff) | |
parent | 735808f48d54aabce540f6c90294e21118104cf4 (diff) | |
download | zsh-3c73976ef306d68a85d60c94be9a1dcdc33fa2bf.tar.gz zsh-3c73976ef306d68a85d60c94be9a1dcdc33fa2bf.tar.bz2 zsh-3c73976ef306d68a85d60c94be9a1dcdc33fa2bf.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'plugins/rustup/rustup.plugin.zsh')
-rw-r--r-- | plugins/rustup/rustup.plugin.zsh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/rustup/rustup.plugin.zsh b/plugins/rustup/rustup.plugin.zsh new file mode 100644 index 000000000..c7a9b3060 --- /dev/null +++ b/plugins/rustup/rustup.plugin.zsh @@ -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 |