scripts/dav-bash-completion.bash

changeset 435
def0359fb48f
parent 434
bc173bae3caa
child 457
0eabb741d5d3
equal deleted inserted replaced
434:bc173bae3caa 435:def0359fb48f
2 local davcmd 2 local davcmd
3 local out 3 local out
4 local cmd_res 4 local cmd_res
5 5
6 davcmd="${COMP_WORDS[0]}" 6 davcmd="${COMP_WORDS[0]}"
7 out=$( $davcmd complete $COMP_CWORD "${COMP_WORDS[@]}" ) 7 out=$( $davcmd complete $COMP_CWORD "${COMP_WORDS[@]}" )
8 cmd_res=$? 8 cmd_res=$?
9 9
10 if [ $cmd_res == 10 ]; then 10 if [ $cmd_res == 10 ]; then
11 compopt -o nospace 11 compopt -o nospace
12 fi 12 fi
13 if [ $cmd_res == 12 ]; then 13 if [ $cmd_res == 12 ]; then
14 compopt -o default 14 compopt -o default
15 COMPREPLY=() 15 COMPREPLY=()
16 else 16 else
17 IFS=$'\n' declare -ga 'COMPREPLY=($out)' 17 IFS=$'\n' declare -ga 'COMPREPLY=($out)'
18 fi 18 fi
19 } 19 }
20 20
21 complete -F dav_completion dav
22

mercurial