-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjeo_bash_comp
32 lines (32 loc) · 1.36 KB
/
jeo_bash_comp
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
31
32
_jeo()
{
local cur=${COMP_WORDS[COMP_CWORD]}
local line=${COMP_LINE}
local cmd=${line##*jeo }
COMPREPLY=()
if [[ "$line" == *"jeo drivers "* ]]; then
COMPREPLY=($(compgen -W '-x --debug -h --help' -- $cur))
elif [[ "$line" == *"jeo info "* ]]; then
COMPREPLY=($(compgen -W '-x --debug -h --help' -- $cur))
elif [[ "$line" == *"jeo query "* ]]; then
COMPREPLY=($(compgen -W '-x --debug -h --help -b --bbox -c --crs -f --filter -i --input -l --limit -o --output -p --props -s --skip' -- $cur))
elif [[ "$line" == *"jeo transform "* ]]; then
COMPREPLY=($(compgen -W '-x --debug -h --help -i --input -o --output -s --script' -- $cur))
elif [[ "$line" == *"jeo " ]]; then
COMPREPLY=($(compgen -W ' drivers info query transform'))
elif [[ "$line" == *"jeo"[[:space:]][[:alpha:]]* ]]; then
if [[ "drivers" == "$cmd"* ]]; then
COMPREPLY=("${COMPREPLY[@]}" $(compgen -W ' drivers'))
fi
if [[ "info" == "$cmd"* ]]; then
COMPREPLY=("${COMPREPLY[@]}" $(compgen -W ' info'))
fi
if [[ "query" == "$cmd"* ]]; then
COMPREPLY=("${COMPREPLY[@]}" $(compgen -W ' query'))
fi
if [[ "transform" == "$cmd"* ]]; then
COMPREPLY=("${COMPREPLY[@]}" $(compgen -W ' transform'))
fi
fi
return 0
} && complete -f -d -F _jeo jeo