mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-12 20:21:02 +01:00
fix(docker): only load old completion if docker <23
This commit is contained in:
parent
54779e5250
commit
fe4b565986
2 changed files with 7 additions and 0 deletions
|
@ -36,6 +36,11 @@ if (( ! $+commands[docker] )); then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Standarized $0 handling
|
||||||
|
# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
|
||||||
|
0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
|
||||||
|
0="${${(M)0:#/*}:-$PWD/$0}"
|
||||||
|
|
||||||
{
|
{
|
||||||
# docker version returns `Docker version 24.0.2, build cb74dfcd85`
|
# docker version returns `Docker version 24.0.2, build cb74dfcd85`
|
||||||
# with `s:,:` remove the comma after the version, and select third word of it
|
# with `s:,:` remove the comma after the version, and select third word of it
|
||||||
|
@ -50,5 +55,7 @@ fi
|
||||||
_comps[docker]=_docker
|
_comps[docker]=_docker
|
||||||
fi
|
fi
|
||||||
command docker completion zsh >| "$ZSH_CACHE_DIR/completions/_docker"
|
command docker completion zsh >| "$ZSH_CACHE_DIR/completions/_docker"
|
||||||
|
else
|
||||||
|
command cp "${0:h}/completions/_docker" "$ZSH_CACHE_DIR/completions/_docker"
|
||||||
fi
|
fi
|
||||||
} &|
|
} &|
|
||||||
|
|
Loading…
Reference in a new issue