summarylogtreecommitdiffstats
path: root/bash-completion.sh
blob: 3d40b88c1b92d237f6686551e277d4f5c57c5818 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
_minetest_worldmapper() 
{
    local cur prev opts base
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"

    opts="--world --config --output --help --version -w -c -o -h -V"

    ### erweiterte Vervollstaendigung ###
    case "${prev}" in

        --world | -w )
            COMPREPLY=( $(compgen -d -- ${cur}) )
            return 0
            ;;

        --config | --output | -c | -o )
	    COMPREPLY=( $(compgen -f -- ${cur}) )
            return 0
            ;;

        *)
        ;;
    esac

    COMPREPLY=($(compgen -W "${opts}" -- ${cur}))  
    return 0
}
complete -o filenames -F _minetest_worldmapper minetest-worldmapper