mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-22 04:51:12 +02:00
Merge 92c28758b9 into a07126330b
This commit is contained in:
commit
17563610bf
2 changed files with 34 additions and 0 deletions
20
plugins/talosctl/README.md
Normal file
20
plugins/talosctl/README.md
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# talosctl plugin
|
||||
|
||||
This plugin adds completion for the [talosctl](https://docs.siderolabs.com/talos/v1.12/learn-more/talosctl) CLI for managing [Talos](https://github.com/siderolabs/talos) Linux.
|
||||
|
||||
To use it, add `talosctl` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... talosctl)
|
||||
```
|
||||
|
||||
This plugin does not add any aliases.
|
||||
|
||||
## Cache
|
||||
|
||||
This plugin caches the completion script and is automatically updated asynchronously when the plugin is
|
||||
loaded, which is usually when you start up a new terminal emulator.
|
||||
|
||||
The cache is stored at:
|
||||
|
||||
- `$ZSH_CACHE/completions/_talosctl` completions script
|
||||
14
plugins/talosctl/talosctl.plugin.zsh
Normal file
14
plugins/talosctl/talosctl.plugin.zsh
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# Autocompletion for talosctl
|
||||
if (( ! $+commands[talosctl] )); then
|
||||
return
|
||||
fi
|
||||
|
||||
# If the completion file doesn't exist yet, we need to autoload it and
|
||||
# bind it to `talosctl`. Otherwise, compinit will have already done that.
|
||||
if [[ ! -f "$ZSH_CACHE_DIR/completions/_talosctl" ]]; then
|
||||
typeset -g -A _comps
|
||||
autoload -Uz _talosctl
|
||||
_comps[talosctl]=_talosctl
|
||||
fi
|
||||
|
||||
talosctl completion zsh >| "$ZSH_CACHE_DIR/completions/_talosctl" &|
|
||||
Loading…
Add table
Add a link
Reference in a new issue