home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / etc / bash_completion.d / rfkill < prev    next >
Encoding:
Text File  |  2010-11-16  |  921 b   |  38 lines

  1. # bash completion for rfkill
  2.  
  3. have rfkill &&
  4. _rfkill()
  5. {
  6.     local cur prev
  7.  
  8.     COMPREPLY=()
  9.     _get_comp_words_by_ref cur prev
  10.  
  11.     if [[ "$cur" == -* ]]; then
  12.         COMPREPLY=( $( compgen -W '--version' -- "$cur" ) )
  13.     else
  14.         case $COMP_CWORD in
  15.             1)
  16.                 COMPREPLY=( $( compgen -W "help event list block unblock" \
  17.                     -- "$cur" ) )
  18.                 ;;
  19.             2)
  20.                 if [[ $prev == block || $prev == unblock ]]; then
  21.                     COMPREPLY=( $( compgen -W "$(rfkill list | awk -F: \
  22.                         '/^[0-9]/ {print $1}') all wifi bluetooth uwb wimax \
  23.                         wwan gps" -- "$cur" ) )
  24.                 fi
  25.                 ;;
  26.         esac
  27.     fi
  28. } &&
  29. complete -F _rfkill rfkill
  30.  
  31. # Local variables:
  32. # mode: shell-script
  33. # sh-basic-offset: 4
  34. # sh-indent-comment: t
  35. # indent-tabs-mode: nil
  36. # End:
  37. # ex: ts=4 sw=4 et filetype=sh
  38.