mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
completion: set up _fdroid_* funcs at load time
This fixes an issue where these functions would not be created until fdroid was completed at least once.
This commit is contained in:
parent
f23011f408
commit
9eef437bca
1 changed files with 13 additions and 10 deletions
|
|
@ -267,19 +267,22 @@ __complete_init() {
|
||||||
__complete_options
|
__complete_options
|
||||||
}
|
}
|
||||||
|
|
||||||
_fdroid() {
|
__cmds=" build init install update publish checkupdates import readmeta \
|
||||||
local cmd cmds
|
rewritemeta lint scanner verify stats server signindex "
|
||||||
cmd=${COMP_WORDS[1]}
|
|
||||||
cmds=" build init install update publish checkupdates import \
|
|
||||||
readmeta rewritemeta lint scanner verify stats server signindex "
|
|
||||||
|
|
||||||
for c in $cmds; do eval "_fdroid_${c} () {
|
for c in $__cmds; do
|
||||||
|
eval "_fdroid_${c} () {
|
||||||
local cur prev opts lopts
|
local cur prev opts lopts
|
||||||
__fdroid_init ${c};
|
__fdroid_init ${c}
|
||||||
}"; done
|
}"
|
||||||
|
done
|
||||||
|
|
||||||
[[ $cmds == *\ $cmd\ * ]] && _fdroid_${cmd} || {
|
_fdroid() {
|
||||||
(($COMP_CWORD == 1)) && COMPREPLY=( $( compgen -W "${cmds}" -- $cmd ) )
|
local cmd
|
||||||
|
cmd=${COMP_WORDS[1]}
|
||||||
|
|
||||||
|
[[ $__cmds == *\ $cmd\ * ]] && _fdroid_${cmd} || {
|
||||||
|
(($COMP_CWORD == 1)) && COMPREPLY=( $( compgen -W "${__cmds}" -- $cmd ) )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue