GSignal: fix trivial docs typo
[platform/upstream/glib.git] / gio / gsettings-bash-completion.sh
1
2 # Check for bash
3 [ -z "$BASH_VERSION" ] && return
4
5 ####################################################################################################
6
7 __gsettings() {
8   local choices
9
10   case "${COMP_CWORD}" in
11     1)
12       choices=$'help \nlist-schemas\nlist-relocatable-schemas\nlist-keys \nlist-children \nget \nrange \nset \nreset \nwritable \nmonitor'
13       ;;
14
15     2)
16       case "${COMP_WORDS[1]}" in
17         help)
18           choices=$'list-schemas\nlist-relocatable-schemas\nlist-keys\nlist-children\nget\nrange\nset\nreset\nwritable\nmonitor'
19           ;;
20         list-keys|list-children)
21           choices="$(gsettings list-schemas)"$'\n'"$(gsettings list-relocatable-schemas | sed -e 's.$.:/.')"
22           ;;
23
24         get|range|set|reset|writable|monitor)
25           choices="$(gsettings list-schemas | sed -e 's.$. .')"$'\n'"$(gsettings list-relocatable-schemas | sed -e 's.$.:/.')"
26           ;;
27       esac
28       ;;
29
30     3)
31       case "${COMP_WORDS[1]}" in
32         set)
33           choices="$(gsettings list-keys ${COMP_WORDS[2]} 2> /dev/null | sed -e 's.$. .')"
34           ;;
35
36         get|range|reset|writable|monitor)
37           choices="$(gsettings list-keys ${COMP_WORDS[2]} 2> /dev/null)"
38           ;;
39       esac
40       ;;
41   esac
42
43   local IFS=$'\n'
44   COMPREPLY=($(compgen -W "${choices}" "${COMP_WORDS[$COMP_CWORD]}"))
45 }
46
47 ####################################################################################################
48
49 complete -o nospace -F __gsettings gsettings