From 1b90aec697b3a163bbab92a83ace7d948a0c4292 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 25 May 2020 21:47:49 +0200 Subject: [PATCH] purge .txt and .json from bash-completion YAML is the way! --- completion/bash-completion | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/completion/bash-completion b/completion/bash-completion index b79b143f..7e2a15da 100644 --- a/completion/bash-completion +++ b/completion/bash-completion @@ -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 ) ) }