tweak bash completion

git-svn-id: http://emdebian.org/svn/current@7157 563faec7-e20c-0410-992a-a66f704d0ccd
This commit is contained in:
codehelp 2010-05-01 07:44:31 +00:00
parent 032799dcb0
commit 2214a82ac2

View file

@ -22,23 +22,23 @@ _get_dpkg_cross_list()
| cut -d':' -f2 | sed -e 's/None, //' | sed -e 's/,//g' | cut -d':' -f2 | sed -e 's/None, //' | sed -e 's/,//g'
} }
_em_multistrap() _multistrap()
{ {
local cur prev opts cmds help machine arch quiet local cur prev opts cmds help dir arch quiet
COMPREPLY=() COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}" cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}" prev="${COMP_WORDS[COMP_CWORD-1]}"
help="-h -? --help --version " help="-h -? --help --version "
arch="-a --arch " arch="-a --arch "
opts="-f --file" opts="-f --file"
machine="" dir="-d --directory"
case "$prev" in case "$prev" in
-@(a|-arch)) -@(a|-arch))
COMPREPLY=( $( _get_dpkg_cross_list $cur ) ) COMPREPLY=( $( _get_dpkg_cross_list $cur ) )
;; ;;
*) *)
COMPREPLY=( $(compgen -W "${arch}${help}${opts}${machine}${cmds}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${arch}${help}${opts}${dir}${cmds}" -- ${cur}) )
;; ;;
esac esac
} }
complete -F _em_multistrap -o default em_multistrap complete -F _multistrap -o default multistrap