mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
complete packages from within the metadata dir too
This commit is contained in:
parent
20f03dede5
commit
f384b5f761
1 changed files with 16 additions and 7 deletions
|
|
@ -23,12 +23,12 @@
|
||||||
#
|
#
|
||||||
# This way, one can simply do 'fbld com.some.app' or 'fcheckup com.some.app'
|
# This way, one can simply do 'fbld com.some.app' or 'fcheckup com.some.app'
|
||||||
|
|
||||||
__package() {
|
__fdroid_cwd() {
|
||||||
[[ -d ./metadata ]] || return 0
|
if [[ "${PWD##*/}" == metadata ]]; then
|
||||||
files=( metadata/*.txt )
|
subdir=
|
||||||
files=( ${files[@]#metadata/} )
|
else
|
||||||
files=${files[@]%.txt}
|
[ -d metadata ] && subdir="metadata/" || return 1
|
||||||
COMPREPLY=( $( compgen -W "$files" -- $cur ) )
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
__fdroid_init() {
|
__fdroid_init() {
|
||||||
|
|
@ -39,6 +39,13 @@ __fdroid_init() {
|
||||||
(( $# >= 1 )) && __complete_${1}
|
(( $# >= 1 )) && __complete_${1}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__package() {
|
||||||
|
files=( ${subdir}*.txt )
|
||||||
|
files=( ${files[@]#${subdir}} )
|
||||||
|
files=${files[@]%.txt}
|
||||||
|
COMPREPLY=( $( compgen -W "$files" -- $cur ) )
|
||||||
|
}
|
||||||
|
|
||||||
__vercode() {
|
__vercode() {
|
||||||
local s p_found p
|
local s p_found p
|
||||||
s=${#COMP_WORDS[*]}
|
s=${#COMP_WORDS[*]}
|
||||||
|
|
@ -63,7 +70,7 @@ __vercode() {
|
||||||
line="${line#*,}"
|
line="${line#*,}"
|
||||||
printf "${line%%,*} "
|
printf "${line%%,*} "
|
||||||
fi
|
fi
|
||||||
done < "metadata/${p}.txt" )" -- $cur ) )
|
done < "${subdir}${p}.txt" )" -- $cur ) )
|
||||||
}
|
}
|
||||||
|
|
||||||
__complete_options() {
|
__complete_options() {
|
||||||
|
|
@ -194,6 +201,7 @@ _fdroid() {
|
||||||
cmd=${COMP_WORDS[1]}
|
cmd=${COMP_WORDS[1]}
|
||||||
cmds=" build init update publish checkupdates import rewritemeta scanner verify stats server "
|
cmds=" build init update publish checkupdates import rewritemeta scanner verify stats server "
|
||||||
aliased=false
|
aliased=false
|
||||||
|
__fdroid_cwd || return 0
|
||||||
|
|
||||||
for c in $cmds; do eval "_fdroid_${c} () {
|
for c in $cmds; do eval "_fdroid_${c} () {
|
||||||
local cur prev cmds opts lopts
|
local cur prev cmds opts lopts
|
||||||
|
|
@ -224,6 +232,7 @@ _fdroid_checkupdates_project() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_fd-commit() {
|
_fd-commit() {
|
||||||
|
__fdroid_cwd || return 0
|
||||||
__package
|
__package
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue