ohmyzsh/plugins/iw/iw.plugin.zsh
Jeremy Melanson 8c079e8160 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
2026-06-07 15:19:04 -04:00

18 lines
447 B
Bash

# 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
}