update bash completion

This commit is contained in:
Yunohost 2012-10-22 22:39:43 +02:00
parent 5703a9b9b4
commit 92eb24df73

View file

@ -8,7 +8,7 @@ COMPREPLY=()
argc=${COMP_CWORD}
cur="${COMP_WORDS[argc]}"
prev="${COMP_WORDS[argc-1]}"
opts=$(yunohost -h | grep usage | awk -F"{" '{print $2}' | awk -F"}" '{print $1}' | tr ',' ' ')
opts=$(yunohost-cli -h | grep usage | awk -F"{" '{print $2}' | awk -F"}" '{print $1}' | tr ',' ' ')
if [[ $argc = 1 ]];
then
@ -19,7 +19,7 @@ if [[ "$prev" != "--help" ]];
then
if [[ $argc = 2 ]];
then
opts2=$(yunohost $prev -h | grep usage | awk -F"{" '{print $2}' | awk -F"}" '{print $1}' | tr ',' ' ')
opts2=$(yunohost-cli $prev -h | grep usage | awk -F"{" '{print $2}' | awk -F"}" '{print $1}' | tr ',' ' ')
COMPREPLY=( $(compgen -W "$opts2 --help" -- $cur ) )
elif [[ $argc = 3 ]];
then
@ -30,4 +30,4 @@ else
fi
}
complete -F _yunohost_cli yunohost
complete -F _yunohost_cli yunohost-cli