1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-03 17:50:11 +02:00

complete packages from within the metadata dir too

This commit is contained in:
Daniel Martí 2013-11-18 15:26:57 +01:00
parent 20f03dede5
commit f384b5f761

View File

@ -23,12 +23,12 @@
#
# This way, one can simply do 'fbld com.some.app' or 'fcheckup com.some.app'
__package() {
[[ -d ./metadata ]] || return 0
files=( metadata/*.txt )
files=( ${files[@]#metadata/} )
files=${files[@]%.txt}
COMPREPLY=( $( compgen -W "$files" -- $cur ) )
__fdroid_cwd() {
if [[ "${PWD##*/}" == metadata ]]; then
subdir=
else
[ -d metadata ] && subdir="metadata/" || return 1
fi
}
__fdroid_init() {
@ -39,6 +39,13 @@ __fdroid_init() {
(( $# >= 1 )) && __complete_${1}
}
__package() {
files=( ${subdir}*.txt )
files=( ${files[@]#${subdir}} )
files=${files[@]%.txt}
COMPREPLY=( $( compgen -W "$files" -- $cur ) )
}
__vercode() {
local s p_found p
s=${#COMP_WORDS[*]}
@ -63,7 +70,7 @@ __vercode() {
line="${line#*,}"
printf "${line%%,*} "
fi
done < "metadata/${p}.txt" )" -- $cur ) )
done < "${subdir}${p}.txt" )" -- $cur ) )
}
__complete_options() {
@ -194,6 +201,7 @@ _fdroid() {
cmd=${COMP_WORDS[1]}
cmds=" build init update publish checkupdates import rewritemeta scanner verify stats server "
aliased=false
__fdroid_cwd || return 0
for c in $cmds; do eval "_fdroid_${c} () {
local cur prev cmds opts lopts
@ -224,6 +232,7 @@ _fdroid_checkupdates_project() {
}
_fd-commit() {
__fdroid_cwd || return 0
__package
}