add completion

This commit is contained in:
Denis Lehmann 2023-09-27 12:23:46 +02:00
parent 03818ff10e
commit 6e78419971
4 changed files with 26 additions and 1 deletions

16
gis_completion.bash Normal file
View file

@ -0,0 +1,16 @@
function _gis_completion {
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
if [[ ${prev} == -p ]] || [[ ${prev} == --path ]]; then
OLDIFS=$IFS
IFS='
'
COMPREPLY=( $(compgen -d -- "${cur}") )
IFS=$OLDIFS
else
args="--help --path fetch pull"
COMPREPLY=( $(compgen -W "${args}" -- "${cur}") )
fi
}
complete -o filenames -F _gis_completion gis