mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-07-17 05:51:18 +02:00
feat!: Add support for "iw" command
- CLI completion for iw (Linux wireless configuration utility). - Directly parses "iw help" output to discover commands and caches the result. - $service is used as the iw binary name. This allows this completion to work for differently-named iw binaries: compdef _iw my-iw-binary
This commit is contained in:
parent
70ad5e3df8
commit
8c079e8160
3 changed files with 277 additions and 0 deletions
17
plugins/iw/iw.plugin.zsh
Normal file
17
plugins/iw/iw.plugin.zsh
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# iw Oh-My-ZSH plugin
|
||||
# Provides tab completion for iw (Linux wireless configuration utility).
|
||||
|
||||
if (( ! $+commands[iw] )); then
|
||||
return
|
||||
fi
|
||||
|
||||
# Remove the cached iw completion data (useful after upgrading iw).
|
||||
iw-clear-cache() {
|
||||
local cache_file="${ZSH_CACHE_DIR:-${HOME}/.cache}/_iw_cache"
|
||||
if [[ -f "$cache_file" ]]; then
|
||||
rm -f "$cache_file"
|
||||
print "iw completion cache cleared."
|
||||
else
|
||||
print "No iw completion cache found."
|
||||
fi
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue