diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:03:18 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:03:18 +0000 |
commit | f4acb49ea148cdd899f7f29f1591c7bc853c2135 (patch) | |
tree | b62d60873864065d6428a84a119dd8a3c90f1397 /completions/iwconfig | |
parent | Adding upstream version 1:2.11. (diff) | |
download | bash-completion-f4acb49ea148cdd899f7f29f1591c7bc853c2135.tar.xz bash-completion-f4acb49ea148cdd899f7f29f1591c7bc853c2135.zip |
Adding upstream version 1:2.12.0.upstream/1%2.12.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'completions/iwconfig')
-rw-r--r-- | completions/iwconfig | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/completions/iwconfig b/completions/iwconfig index aa8fbf3..7fbc985 100644 --- a/completions/iwconfig +++ b/completions/iwconfig @@ -1,90 +1,90 @@ # iwconfig completion -*- shell-script -*- -_iwconfig() +_comp_deprecate_var 2.12 \ + COMP_IWLIST_SCAN BASH_COMPLETION_CMD_IWCONFIG_SCAN + +_comp_cmd_iwconfig() { - local cur prev words cword - _init_completion || return + local cur prev words cword comp_args + _comp_initialize -- "$@" || return case $prev in mode) - COMPREPLY=($(compgen -W 'managed ad-hoc master repeater secondary - monitor' -- "$cur")) + _comp_compgen -- -W 'managed ad-hoc master repeater secondary + monitor' return ;; essid) - COMPREPLY=($(compgen -W 'on off any' -- "$cur")) - if [[ -n ${COMP_IWLIST_SCAN:-} ]]; then - COMPREPLY+=($(compgen -W \ - "$(iwlist ${words[1]} scan | - awk -F'\"' '/ESSID/ {print $2}')" -- "$cur")) + _comp_compgen -- -W 'on off any' + if [[ ${BASH_COMPLETION_CMD_IWCONFIG_SCAN-} ]]; then + _comp_compgen -a split -- "$(iwlist "${words[1]}" scan | + _comp_awk -F '\"' '/ESSID/ {print $2}')" fi return ;; nwid) - COMPREPLY=($(compgen -W 'on off' -- "$cur")) + _comp_compgen -- -W 'on off' return ;; channel) - COMPREPLY=($(compgen -W "$(iwlist ${words[1]} channel | - awk '/^[ \t]*Channel/ {print $2}')" -- "$cur")) + _comp_compgen_split -- "$(iwlist "${words[1]}" channel | + _comp_awk '/^[ \t]*Channel/ {print $2}')" return ;; freq) - COMPREPLY=($(compgen -W "$(iwlist ${words[1]} channel | - awk '/^[ \t]*Channel/ {print $4"G"}')" -- "$cur")) + _comp_compgen_split -- "$(iwlist "${words[1]}" channel | + _comp_awk '/^[ \t]*Channel/ {print $4"G"}')" return ;; ap) - COMPREPLY=($(compgen -W 'on off any' -- "$cur")) - if [[ -n ${COMP_IWLIST_SCAN:-} ]]; then - COMPREPLY+=($(compgen -W \ - "$(iwlist ${words[1]} scan | - awk -F ': ' '/Address/ {print $2}')" -- "$cur")) + _comp_compgen -- -W 'on off any' + if [[ ${BASH_COMPLETION_CMD_IWCONFIG_SCAN-} ]]; then + _comp_compgen -a split -- "$(iwlist "${words[1]}" scan | + _comp_awk -F ': ' '/Address/ {print $2}')" fi return ;; rate) - COMPREPLY=($(compgen -W 'auto fixed' -- "$cur")) - COMPREPLY+=($(compgen -W \ - "$(iwlist ${words[1]} rate | - awk '/^[ \t]*[0-9]/ {print $1"M"}')" -- "$cur")) + _comp_compgen -- -W 'auto fixed' + _comp_compgen -a split -- "$(iwlist "${words[1]}" rate | + _comp_awk '/^[ \t]*[0-9]/ {print $1"M"}')" return ;; rts | frag) - COMPREPLY=($(compgen -W 'auto fixed off' -- "$cur")) + _comp_compgen -- -W 'auto fixed off' return ;; key | enc) - COMPREPLY=($(compgen -W 'off on open restricted' -- "$cur")) + _comp_compgen -- -W 'off on open restricted' return ;; power) - COMPREPLY=($(compgen -W 'period timeout off on' -- "$cur")) + _comp_compgen -- -W 'period timeout off on' return ;; txpower) - COMPREPLY=($(compgen -W 'off on auto' -- "$cur")) + _comp_compgen -- -W 'off on auto' return ;; retry) - COMPREPLY=($(compgen -W 'limit lifetime' -- "$cur")) + _comp_compgen -- -W 'limit lifetime' return ;; esac if ((cword == 1)); then if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--help --version' -- "$cur")) + _comp_compgen -- -W '--help --version' else - _available_interfaces -w + _comp_compgen_available_interfaces -w fi else - COMPREPLY=($(compgen -W 'essid nwid mode freq channel sens mode ap - nick rate rts frag enc key power txpower commit' -- "$cur")) + _comp_compgen -- -W 'essid nwid mode freq channel sens mode ap nick + rate rts frag enc key power txpower commit' fi } && - complete -F _iwconfig iwconfig + complete -F _comp_cmd_iwconfig iwconfig # ex: filetype=sh |