mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
update bash completion
This commit is contained in:
parent
de5b55bb02
commit
9b7c0b551b
1 changed files with 3 additions and 3 deletions
|
@ -8,7 +8,7 @@ COMPREPLY=()
|
||||||
argc=${COMP_CWORD}
|
argc=${COMP_CWORD}
|
||||||
cur="${COMP_WORDS[argc]}"
|
cur="${COMP_WORDS[argc]}"
|
||||||
prev="${COMP_WORDS[argc-1]}"
|
prev="${COMP_WORDS[argc-1]}"
|
||||||
opts=$(yunohost-cli -h | grep usage | awk -F"{" '{print $2}' | awk -F"}" '{print $1}' | tr ',' ' ')
|
opts=$(yunohost -h | sed -n "/usage/,/}/p" | awk -F"{" '{print $2}' | awk -F"}" '{print $1}' | tr ',' ' ')
|
||||||
|
|
||||||
if [[ $argc = 1 ]];
|
if [[ $argc = 1 ]];
|
||||||
then
|
then
|
||||||
|
@ -19,7 +19,7 @@ if [[ "$prev" != "--help" ]];
|
||||||
then
|
then
|
||||||
if [[ $argc = 2 ]];
|
if [[ $argc = 2 ]];
|
||||||
then
|
then
|
||||||
opts2=$(yunohost-cli $prev -h | grep usage | awk -F"{" '{print $2}' | awk -F"}" '{print $1}' | tr ',' ' ')
|
opts2=$(yunohost $prev -h | sed -n "/usage/,/}/p" | awk -F"{" '{print $2}' | awk -F"}" '{print $1}' | tr ',' ' ')
|
||||||
COMPREPLY=( $(compgen -W "$opts2 --help" -- $cur ) )
|
COMPREPLY=( $(compgen -W "$opts2 --help" -- $cur ) )
|
||||||
elif [[ $argc = 3 ]];
|
elif [[ $argc = 3 ]];
|
||||||
then
|
then
|
||||||
|
@ -30,4 +30,4 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
complete -F _yunohost_cli yunohost-cli
|
complete -F _yunohost_cli yunohost
|
||||||
|
|
Loading…
Add table
Reference in a new issue