2014-04-12 21:59:41 +00:00
|
|
|
#! /bin/bash
|
|
|
|
|
2015-08-29 01:15:08 +00:00
|
|
|
: ${PROG:=$(basename ${BASH_SOURCE})}
|
|
|
|
|
2014-04-12 21:59:41 +00:00
|
|
|
_cli_bash_autocomplete() {
|
2017-04-06 13:11:23 +00:00
|
|
|
local cur opts base
|
|
|
|
COMPREPLY=()
|
|
|
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
2019-03-20 14:58:51 +00:00
|
|
|
if [[ $cur == -* ]]; then
|
|
|
|
opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} ${cur} --generate-bash-completion )
|
|
|
|
else
|
|
|
|
opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-bash-completion )
|
|
|
|
fi
|
2017-04-06 13:11:23 +00:00
|
|
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
complete -F _cli_bash_autocomplete $PROG
|
|
|
|
|
|
|
|
unset PROG
|