[zsh] Generate kubectl completions

This commit is contained in:
Alyxia Sother 2023-06-05 09:48:10 +02:00
parent 688848fa5b
commit dd46d9d935
No known key found for this signature in database
GPG Key ID: 01E16C4E775A37E4
1 changed files with 9 additions and 0 deletions

View File

@ -37,6 +37,15 @@ _plugin project 'https://git.sr.ht/~keanucode/scripts/blob/master/project/projec
unset bw_comp_path
fi; unset bw_bin
if kctl_bin="$(command_locate kubectl)" && [[ -n "$kctl_bin" ]]; then
kctl_comp_path="${ZSH_CACHE_DIR}/site-functions/_kubectl"
if [[ "$kctl_bin" -nt "$kctl_comp_path" || ! -s "$kctl_comp_path" ]]; then
_perf_timer_start "generate kubectl completions"
"$kctl_bin" completion zsh >| "$kctl_comp_path"
_perf_timer_stop "generate kubectl completions"
fi
fi; unset kctl_comp_path
_plugin nim-compl 'https://raw.githubusercontent.com/nim-lang/Nim/devel/tools/nim.zsh-completion' from=url \
after_load='plugin-cfg-path fpath prepend ""'