File: ditz.bash

package info (click to toggle)
ditz 0.5-1
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 356 kB
  • ctags: 489
  • sloc: ruby: 3,664; sh: 15; makefile: 12
file content (22 lines) | stat: -rw-r--r-- 611 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# ditz bash completion
#
# author: Christian Garbs
#
# based on bzr.simple by Martin Pool

_ditz() 
{
    local cur=${COMP_WORDS[COMP_CWORD]}
    if [ $COMP_CWORD -eq 1 ]; then
	COMPREPLY=( $( compgen -W "$(ditz --commands)" -- $cur ) )
    elif [ $COMP_CWORD -eq 2 ]; then
	local cmd=${COMP_WORDS[1]}
	COMPREPLY=( $( compgen -W "$(ditz "$cmd" '<options>' 2>/dev/null)" -- $cur ) )
    elif [ $COMP_CWORD -eq 3 ]; then
	local cmd=${COMP_WORDS[1]}
	local parm1=${COMP_WORDS[2]}
	COMPREPLY=( $( compgen -W "$(ditz "$cmd" "$parm1" '<options>' 2>/dev/null)" -- $cur ) )
    fi 
}

complete -F _ditz -o default ditz