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 / cvsps < prev    next >
Encoding:
Text File  |  2010-11-16  |  1.8 KB  |  70 lines

  1. # bash completion for cvsps
  2.  
  3. have cvsps &&
  4. _cvsps()
  5. {
  6.     COMPREPLY=()
  7.     local cur prev
  8.     _get_comp_words_by_ref -n : cur prev
  9.  
  10.     case $prev in
  11.         -h|-z|-f|-d|-l|--diff-opts|--debuglvl)
  12.             return 0
  13.             ;;
  14.         -s)
  15.             COMPREPLY=( $( compgen -W "$( cvsps 2>/dev/null |
  16.                 awk '/^PatchSet:?[ \t]/ { print $2 }' )" -- "$cur" ) )
  17.             return 0
  18.             ;;
  19.         -a)
  20.             COMPREPLY=( $( compgen -W "$( cvsps 2>/dev/null |
  21.                 awk '/^Author:[ \t]/ { print $2 }' )" -- "$cur" ) )
  22.             return 0
  23.             ;;
  24.         -b)
  25.             COMPREPLY=( $( compgen -W "$( cvsps 2>/dev/null |
  26.                 awk '/^Branch:[ \t]/ { print $2 }' )" -- "$cur" ) )
  27.             return 0
  28.             ;;
  29.         -r)
  30.             COMPREPLY=( $( compgen -W "$( cvsps 2>/dev/null |
  31.                 awk '/^Tag:[ \t]+[^(]/ { print $2 }' )" -- "$cur" ) )
  32.             return 0
  33.             ;;
  34.         -p)
  35.             _filedir -d
  36.             return 0
  37.             ;;
  38.         --test-log)
  39.             _filedir
  40.             return 0
  41.             ;;
  42.         -Z)
  43.             COMPREPLY=( $( compgen -W '1 2 3 4 5 6 7 8 9' -- "$cur" ) )
  44.             return 0
  45.             ;;
  46.         --root)
  47.             type _cvs_roots &>/dev/null && _cvs_roots
  48.             return 0
  49.             ;;
  50.     esac
  51.  
  52.     if [[ "$cur" == -* ]] ; then
  53.         COMPREPLY=( $( compgen -W '-h -x -u -z -g -s -a -f -d -b -l -r -p -v \
  54.             -t --norc --summary-first --test-log --diff-opts --bkcvs --no-rlog \
  55.             --cvs-direct --no-cvs-direct --debuglvl -Z --root -q -A' \
  56.             -- "$cur" ) )
  57.     else
  58.         type _cvs_roots &>/dev/null && _cvs_roots
  59.     fi
  60. } &&
  61. complete -F _cvsps cvsps
  62.  
  63. # Local variables:
  64. # mode: shell-script
  65. # sh-basic-offset: 4
  66. # sh-indent-comment: t
  67. # indent-tabs-mode: nil
  68. # End:
  69. # ex: ts=4 sw=4 et filetype=sh
  70.