Verified Commit 599b940e authored by 6543's avatar 6543

testing/tea: add tea-bash-completion subpackage

parent 13332633
......@@ -9,7 +9,9 @@ arch="all !mips !mips64" # go is missing
license="MIT"
makedepends="go"
options="!check" # no testsuite
source="$pkgname-$pkgver.tar.gz::https://gitea.com/gitea/tea/archive/v$pkgver.tar.gz"
subpackages="$pkgname-bash-completion"
source="$pkgname-$pkgver.tar.gz::https://gitea.com/gitea/tea/archive/v$pkgver.tar.gz
bash_autocomplete"
builddir="$srcdir/src/code.gitea.io/$pkgname"
......@@ -28,6 +30,8 @@ build() {
package() {
install -Dm755 "$builddir"/$pkgname "$pkgdir"/usr/bin/$pkgname
install -Dm644 "$srcdir"/bash_autocomplete "$pkgdir"/usr/share/bash-completion/completions/tea
}
sha512sums="8745b3fa6b10a988f3d2996d74c75872e5b8965b41bbb455c53707c26d04ccd87a01e6042967233decd10727ae52887ddff2787a64e9064e46a455902f0d1b74 tea-0.4.0.tar.gz"
sha512sums="8745b3fa6b10a988f3d2996d74c75872e5b8965b41bbb455c53707c26d04ccd87a01e6042967233decd10727ae52887ddff2787a64e9064e46a455902f0d1b74 tea-0.4.0.tar.gz
d89c90cde59ec43c0ff3eb9db9928cbb8be765e264eff8dabf2889507a5fe5d4799d89a7b02832c11954d684f232e1265f4aa740c9c5e26954d2ac8f7d4a7a57 bash_autocomplete"
#! /bin/bash
: ${PROG:=$(basename ${BASH_SOURCE})}
_cli_bash_autocomplete() {
if [[ "${COMP_WORDS[0]}" != "source" ]]; then
local cur opts base
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
if [[ "$cur" == "-"* ]]; then
opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} ${cur} --generate-bash-completion )
else
opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-bash-completion )
fi
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
fi
}
complete -o bashdefault -o default -o nospace -F _cli_bash_autocomplete $PROG
unset PROG
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment