# bash completion for rfkill -*- shell-script -*- proc _rfkill { local cur prev words cword _init_completion || return if [[ "$cur" == -* ]] { setglobal COMPREPLY = ''( $( compgen -W '--version' -- "$cur" ) ) } else { match $cword { with 1 setglobal COMPREPLY = ''( $( compgen -W "help event list block unblock" \ -- "$cur" ) ) with 2 if [[ $prev == block || $prev == unblock ]] { setglobal COMPREPLY = ''( $( compgen -W "$($1 list | awk -F: \ '/^[0-9]/ {print $1}') all wifi bluetooth uwb wimax \ wwan gps" -- "$cur" ) ) } } } } && complete -F _rfkill rfkill # ex: ts=4 sw=4 et filetype=sh