.bash_completion.d/apt-cyg
changeset 815 ccdb84df15b7
child 824 b8ac1e0a719a
equal deleted inserted replaced
814:83aaaf45479a 815:ccdb84df15b7
       
     1 # -*- mode: sh; sh-shell-file: bash -*-
       
     2 
       
     3 _apt_cyg()
       
     4 {
       
     5   local _cmds="install remove update download show depends rdepends list listall category listfiles search searchall mirror cache"
       
     6   local cur
       
     7   cur=${COMP_WORDS[COMP_CWORD]}
       
     8   if [[ $COMP_CWORD = 1 ]]; then
       
     9       COMPREPLY=( $(compgen -W '$_cmds' -- "$cur") )
       
    10       return 0
       
    11   fi
       
    12   local _cmd=${COMP_WORDS[1]}
       
    13   case "$_cmd" in
       
    14     install|remove|download|show|depends|rdepends)
       
    15       COMPREPLY=( $(apt-cyg listall ^"$cur") )
       
    16       return 0 ;;
       
    17     update|list|listall|category|listfiles|search|searchall|mirror)
       
    18       COMPREPLY=( )
       
    19       return 0 ;;
       
    20     cache)
       
    21       COMPREPLY=( $(compgen -d -- "$cur") )
       
    22       return 0 ;;
       
    23     *)
       
    24       return 1 ;;
       
    25   esac
       
    26 } &&
       
    27     complete -F _apt_cyg apt-cyg