5 cur="${COMP_WORDS[COMP_CWORD]}"
6 prev="${COMP_WORDS[COMP_CWORD-1]}"
8 'list'|'block'|'unblock')
10 targets="$(rfkill --output=id,type --noheadings list)"
11 COMPREPLY=( $(compgen -W "all $targets" -- $cur) )
15 local prefix realcur OUTPUT
17 prefix="${cur%$realcur}"
18 for WORD in "DEVICE TYPE ID SOFT HARD"; do
19 if ! [[ $prefix == *"$WORD"* ]]; then
20 OUTPUT="$WORD ${OUTPUT:-""}"
24 COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) )
27 '-h'|'--help'|'-V'|'--version')
44 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
48 complete -F _rfkill_module rfkill