mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-06-16 11:36:16 +08:00
- 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
18 lines
447 B
Bash
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
|
|
}
|