# HG changeset patch # User Oleksandr Gavenko # Date 1485288885 -7200 # Node ID ccdb84df15b76a0265c3c390c9599a057d9f7238 # Parent 83aaaf45479a898ca7fc1a7489379c674eda92fd Basic completion for apt-cyg. diff -r 83aaaf45479a -r ccdb84df15b7 .bash_completion.d/apt-cyg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.bash_completion.d/apt-cyg Tue Jan 24 22:14:45 2017 +0200 @@ -0,0 +1,27 @@ +# -*- mode: sh; sh-shell-file: bash -*- + +_apt_cyg() +{ + local _cmds="install remove update download show depends rdepends list listall category listfiles search searchall mirror cache" + local cur + cur=${COMP_WORDS[COMP_CWORD]} + if [[ $COMP_CWORD = 1 ]]; then + COMPREPLY=( $(compgen -W '$_cmds' -- "$cur") ) + return 0 + fi + local _cmd=${COMP_WORDS[1]} + case "$_cmd" in + install|remove|download|show|depends|rdepends) + COMPREPLY=( $(apt-cyg listall ^"$cur") ) + return 0 ;; + update|list|listall|category|listfiles|search|searchall|mirror) + COMPREPLY=( ) + return 0 ;; + cache) + COMPREPLY=( $(compgen -d -- "$cur") ) + return 0 ;; + *) + return 1 ;; + esac +} && + complete -F _apt_cyg apt-cyg