f77c09c2a5
This is to allow python-heatclient to eventually become the default heat client. Documentation in heat.wiki will be updated to refer to heat-cfn when this change is pushed. Change-Id: I2209c36adf41fa5d0df0caf9200f7fedbdd51805
23 lines
687 B
Plaintext
23 lines
687 B
Plaintext
_heat()
|
|
{
|
|
local cur prev opts
|
|
COMPREPLY=()
|
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
|
|
if [[ ${cur} == -* ]]; then
|
|
opts=$(heat-cfn --help | grep -A100 "^Options" | sed -r "s/^[[:space:]]*-[[:alpha:]]([[:space:]][[:alpha:]_]*,|,)[[:space:]]//" | cut -d "=" -f1 | grep "^--" | awk '{print $1}')
|
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
|
return 0
|
|
fi
|
|
|
|
if [[ ${#COMP_WORDS[@]} -gt 2 ]]; then
|
|
return 0
|
|
else
|
|
cmds=$(heat-cfn help | awk '{print $1}' | egrep -v "^(Usage|Commands|$)")
|
|
COMPREPLY=( $(compgen -W "${cmds}" -- ${cur}) )
|
|
return 0
|
|
fi
|
|
}
|
|
complete -F _heat heat-cfn
|