regex: Update included PCRE to 8.30
[glib.git] / gio / gresource-bash-completion.sh
blobef1145d62aa84d00ebeb1485275c31e2b1d37a08
2 # Check for bash
3 [ -z "$BASH_VERSION" ] && return
5 ####################################################################################################
7 __gresource() {
8 local choices coffset section
10 if [ ${COMP_CWORD} -gt 2 ]; then
11 if [ ${COMP_WORDS[1]} = --section ]; then
12 section=${COMP_WORDS[2]}
13 coffset=2
14 else
15 coffset=0
17 else
18 coffset=0
21 case "$((${COMP_CWORD}-$coffset))" in
23 choices=$'--section \nhelp \nsections \nlist \ndetails \nextract '
27 case "${COMP_WORDS[$(($coffset+1))]}" in
28 --section)
29 return 0
32 help)
33 choices=$'sections\nlist\ndetails\nextract'
36 sections|list|details|extract)
37 COMPREPLY=($(compgen -f -- ${COMP_WORDS[${COMP_CWORD}]}))
38 return 0
40 esac
44 case "${COMP_WORDS[$(($coffset+1))]}" in
45 list|details|extract)
46 choices="$(gresource list ${COMP_WORDS[$(($coffset+2))]} 2> /dev/null | sed -e 's.$. .')"
48 esac
50 esac
52 local IFS=$'\n'
53 COMPREPLY=($(compgen -W "${choices}" -- "${COMP_WORDS[${COMP_CWORD}]}"))
56 ####################################################################################################
58 complete -o nospace -F __gresource gresource