mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-24 21:16:25 -07:00
Merge c042ff4d41
into 048e166c9e
This commit is contained in:
commit
054cb6523e
9
plugins/stern/README.md
Normal file
9
plugins/stern/README.md
Normal file
@ -0,0 +1,9 @@
|
||||
# Stern plugin
|
||||
|
||||
This plugin adds completion for [Stern](https://github.com/stern/stern), the multi pod and container log tailing for Kubernetes.
|
||||
|
||||
To use it, add `stern` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... stern)
|
||||
```
|
14
plugins/stern/stern.plugin.zsh
Normal file
14
plugins/stern/stern.plugin.zsh
Normal file
@ -0,0 +1,14 @@
|
||||
# Completion
|
||||
if (( ! $+commands[stern] )); then
|
||||
return
|
||||
fi
|
||||
|
||||
# If the completion file doesn't exist yet, we need to autoload it and
|
||||
# bind it to `stern`. Otherwise, compinit will have already done that.
|
||||
if [[ ! -f "$ZSH_CACHE_DIR/completions/_stern" ]]; then
|
||||
typeset -g -A _comps
|
||||
autoload -Uz _stern
|
||||
_comps[stern]=_stern
|
||||
fi
|
||||
|
||||
stern --completion zsh >| "$ZSH_CACHE_DIR/completions/_stern" &|
|
Loading…
Reference in New Issue
Block a user