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

View file

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