purge .txt and .json from bash-completion

YAML is the way!
This commit is contained in:
Hans-Christoph Steiner 2020-05-25 21:47:49 +02:00
parent b63e9e68c5
commit 1b90aec697
No known key found for this signature in database
GPG Key ID: 3E177817BA1B9BFA
1 changed files with 4 additions and 5 deletions

View File

@ -26,16 +26,15 @@ __fdroid_init() {
(( $# >= 1 )) && __complete_${1}
}
__by_ext() {
local ext="$1"
files=( metadata/*.$ext )
__get_appid() {
files=( metadata/*.yml )
files=( ${files[@]#metadata/} )
files=${files[@]%.$ext}
files=${files[@]%.yml}
echo "$files"
}
__package() {
files="$(__by_ext txt) $(__by_ext yml) $(__by_ext json)"
files="$(__get_appid)"
COMPREPLY=( $( compgen -W "$files" -- $cur ) )
}