2011-11-01 22:14:45 +02:00
|
|
|
# bash completion for rfkill -*- shell-script -*-
|
2009-09-20 22:12:01 +02:00
|
|
|
|
|
|
|
_rfkill()
|
|
|
|
{
|
2011-04-21 11:04:51 +03:00
|
|
|
local cur prev words cword
|
|
|
|
_init_completion || return
|
2009-10-04 19:42:50 +02:00
|
|
|
|
|
|
|
if [[ "$cur" == -* ]]; then
|
|
|
|
COMPREPLY=( $( compgen -W '--version' -- "$cur" ) )
|
|
|
|
else
|
2011-04-21 11:04:51 +03:00
|
|
|
case $cword in
|
2009-10-04 19:42:50 +02:00
|
|
|
1)
|
|
|
|
COMPREPLY=( $( compgen -W "help event list block unblock" \
|
|
|
|
-- "$cur" ) )
|
|
|
|
;;
|
|
|
|
2)
|
2009-11-23 20:08:52 +02:00
|
|
|
if [[ $prev == block || $prev == unblock ]]; then
|
2014-11-16 12:18:41 +02:00
|
|
|
COMPREPLY=( $( compgen -W "$($1 list | awk -F: \
|
2009-10-04 19:42:50 +02:00
|
|
|
'/^[0-9]/ {print $1}') all wifi bluetooth uwb wimax \
|
|
|
|
wwan gps" -- "$cur" ) )
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
2009-09-20 22:12:01 +02:00
|
|
|
} &&
|
|
|
|
complete -F _rfkill rfkill
|
|
|
|
|
2009-10-04 19:42:50 +02:00
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|