3 [ -z "$BASH_VERSION" ] && return
5 ####################################################################################################
10 case "${COMP_CWORD}" in
12 choices=$'help \nlist-schemas\nlist-relocatable-schemas\nlist-keys \nlist-children \nlist-recursively \nget \nrange \nset \nreset \nwritable \nmonitor'
16 case "${COMP_WORDS[1]}" in
18 choices=$'list-schemas\nlist-relocatable-schemas\nlist-keys\nlist-children\nlist-recursively\nget\nrange\nset\nreset\nwritable\nmonitor'
20 list-keys|list-children|list-recursively)
21 choices="$(gsettings list-schemas)"$'\n'"$(gsettings list-relocatable-schemas | sed -e 's.$.:/.')"
24 get|range|set|reset|writable|monitor)
25 choices="$(gsettings list-schemas | sed -e 's.$. .')"$'\n'"$(gsettings list-relocatable-schemas | sed -e 's.$.:/.')"
31 case "${COMP_WORDS[1]}" in
33 choices="$(gsettings list-keys ${COMP_WORDS[2]} 2> /dev/null | sed -e 's.$. .')"
36 get|range|reset|writable|monitor)
37 choices="$(gsettings list-keys ${COMP_WORDS[2]} 2> /dev/null)"
43 case "${COMP_WORDS[1]}" in
45 range=($(gsettings range ${COMP_WORDS[2]} ${COMP_WORDS[3]} 2> /dev/null))
62 COMPREPLY=($(compgen -W "${choices}" "${COMP_WORDS[$COMP_CWORD]}"))
65 ####################################################################################################
67 complete -o nospace -F __gsettings gsettings