engine: issue warnings once per source
[dconf.git] / bin / completion / dconf
blob37ab47711b84dee3c148c7e0b25072ca00549106
2 # Check for bash
3 [ -z "$BASH_VERSION" ] && return
5 ####################################################################################################
7 __dconf() {
8   local choices
10   case "${COMP_CWORD}" in
11     1)
12       choices=$'help \nread \nlist \nwrite \nreset\n update \nlock \nunlock \nwatch \ndump \nload '
13       ;;
15     2)
16       case "${COMP_WORDS[1]}" in
17         help)
18           choices=$'help \nread \nlist \nwrite \nreset\n update \nlock \nunlock \nwatch \ndump \nload '
19           ;;
20         list|dump|load)
21           choices="$(dconf _complete / "${COMP_WORDS[2]}")"
22           ;;
23         read|list|write|lock|unlock|watch|reset)
24           choices="$(dconf _complete '' "${COMP_WORDS[2]}")"
25           ;;
26       esac
27       ;;
29     3)
30       case "${COMP_WORDS[1]} ${COMP_WORDS[2]}" in
31         reset\ -f)
32           choices="$(dconf _complete '' "${COMP_WORDS[3]}")"
33           ;;
34       esac
35       ;;
36   esac
38   local IFS=$'\n'
39   COMPREPLY=($(compgen -W "${choices}" "${COMP_WORDS[$COMP_CWORD]}"))
42 ####################################################################################################
44 complete -o nospace -F __dconf dconf