chiark
/
gitweb
/
~ianmdlvl
/
fdroidserver.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ac37e30
)
bash-completion: add appid support for all formats
author
Daniel Martí
<mvdan@mvdan.cc>
Sun, 4 Oct 2015 10:08:28 +0000
(
03:08
-0700)
committer
Daniel Martí
<mvdan@mvdan.cc>
Sun, 4 Oct 2015 14:55:55 +0000
(07:55 -0700)
completion/bash-completion
patch
|
blob
|
history
diff --git
a/completion/bash-completion
b/completion/bash-completion
index 09683437b717afe6302bc8e2bdcf4b2e81a0b268..f0ce84a355305a84b1a83c7f1b6b889cd4d7deed 100644
(file)
--- a/
completion/bash-completion
+++ b/
completion/bash-completion
@@
-37,10
+37,16
@@
__fdroid_init() {
(( $# >= 1 )) && __complete_${1}
}
-__package() {
- files=( metadata/*.txt )
+__by_ext() {
+ local ext="$1"
+ files=( metadata/*.$ext )
files=( ${files[@]#metadata/} )
- files=${files[@]%.txt}
+ files=${files[@]%.$ext}
+ echo "$files"
+}
+
+__package() {
+ files="$(__by_ext txt) $(__by_ext yaml) $(__by_ext json) $(__by_ext xml)"
COMPREPLY=( $( compgen -W "$files" -- $cur ) )
}