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 / jar < prev    next >
Encoding:
Text File  |  2010-11-16  |  620 b   |  37 lines

  1. # jar(1) completion
  2.  
  3. have jar &&
  4. _jar()
  5. {
  6.     local cur
  7.  
  8.     COMPREPLY=()
  9.     _get_comp_words_by_ref cur
  10.  
  11.     if [ $COMP_CWORD = 1 ]; then
  12.         COMPREPLY=( $( compgen -W 'c t x u' -- "$cur" ) )
  13.         return 0
  14.     fi
  15.  
  16.     case ${COMP_WORDS[1]} in
  17.         *c*f)
  18.             _filedir
  19.             ;;
  20.         *f)
  21.             _filedir '?([ejw]ar|zip|[EJW]AR|ZIP)'
  22.             ;;
  23.         *)
  24.             _filedir
  25.             ;;
  26.     esac
  27. } &&
  28. complete -F _jar -o filenames jar
  29.  
  30. # Local variables:
  31. # mode: shell-script
  32. # sh-basic-offset: 4
  33. # sh-indent-comment: t
  34. # indent-tabs-mode: nil
  35. # End:
  36. # ex: ts=4 sw=4 et filetype=sh
  37.