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 / chkconfig < prev    next >
Encoding:
Text File  |  2010-11-16  |  980 b   |  45 lines

  1. # chkconfig(8) completion
  2.  
  3. have chkconfig &&
  4. _chkconfig()
  5. {
  6.     local cur prev split=false
  7.  
  8.     COMPREPLY=()
  9.     _get_comp_words_by_ref cur prev
  10.  
  11.     _split_longopt && split=true
  12.  
  13.     case $prev in
  14.         --level=[1-6]|[1-6]|--list|--add|--del|--override)
  15.             _services
  16.             return 0
  17.             ;;
  18.         --level)
  19.             COMPREPLY=( $( compgen -W '1 2 3 4 5 6' -- "$cur" ) )
  20.             return 0
  21.             ;;
  22.     esac
  23.  
  24.     $split && return 0
  25.  
  26.     if [[ "$cur" == -* ]]; then
  27.         COMPREPLY=( $( compgen -W '--list --add --del --override --level' -- "$cur" ) )
  28.     else
  29.         if [[ $COMP_CWORD -eq 2 || $COMP_CWORD -eq 4 ]]; then
  30.             COMPREPLY=( $( compgen -W 'on off reset resetpriorities' -- "$cur" ) )
  31.         else
  32.             _services
  33.         fi
  34.     fi
  35. } &&
  36. complete -F _chkconfig chkconfig
  37.  
  38. # Local variables:
  39. # mode: shell-script
  40. # sh-basic-offset: 4
  41. # sh-indent-comment: t
  42. # indent-tabs-mode: nil
  43. # End:
  44. # ex: ts=4 sw=4 et filetype=sh
  45.