diff options
| author | Shulhan <ms@kilabit.info> | 2024-01-14 02:02:07 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2024-01-16 00:09:02 +0700 |
| commit | 61c31da5b6a84ae1d0857b8e676e5683b8f8c245 (patch) | |
| tree | ab1c10531fb4f51990f1f79621e8e1965f6313ff | |
| parent | d18a8ee292ccdd32fbbb1a85a6cc0e2d48249629 (diff) | |
| download | awwan-61c31da5b6a84ae1d0857b8e676e5683b8f8c245.tar.xz | |
all: add bash completion script
While at it, set the AUR architecture to 'any' since Go can be build
on all ArchLinux supported architecture; and update the url variable
to official awwan website.
References: https://todo.sr.ht/~shulhan/awwan/10
| -rw-r--r-- | .gitignore | 5 | ||||
| -rw-r--r-- | _AUR/.SRCINFO | 6 | ||||
| -rw-r--r-- | _AUR/.gitignore | 7 | ||||
| -rw-r--r-- | _AUR/PKGBUILD | 29 | ||||
| -rw-r--r-- | _sys/usr/share/bash-completion/completions/awwan | 49 |
5 files changed, 77 insertions, 19 deletions
@@ -3,11 +3,6 @@ /.cache /CHANGELOG.html /README.html -/_AUR/*.tar.zst -/_AUR/awwan-git -/_AUR/pkg -/_AUR/src -/_AUR/wui /_doc/*.html /_example/.cache /_mkosi/awwan-test diff --git a/_AUR/.SRCINFO b/_AUR/.SRCINFO index ee79fee..6827e89 100644 --- a/_AUR/.SRCINFO +++ b/_AUR/.SRCINFO @@ -1,9 +1,9 @@ pkgbase = awwan-git pkgdesc = Configuration management software, infrastructure as file and directory layout. - pkgver = 0.10.0.r0.gf30f148 + pkgver = 0.11.0.r2.g5e4e1d7 pkgrel = 1 - url = https://git.sr.ht/~shulhan/awwan - arch = x86_64 + url = https://awwan.org + arch = any license = GPL3 makedepends = go makedepends = git diff --git a/_AUR/.gitignore b/_AUR/.gitignore new file mode 100644 index 0000000..846a481 --- /dev/null +++ b/_AUR/.gitignore @@ -0,0 +1,7 @@ +/*.tar.zst +/awwan-git +/awwan-git-local +/pkg +/src +/wui +/wui-local diff --git a/_AUR/PKGBUILD b/_AUR/PKGBUILD index b3ea88b..02b325b 100644 --- a/_AUR/PKGBUILD +++ b/_AUR/PKGBUILD @@ -1,12 +1,12 @@ # Maintainer: shulhan <ms@kilabit.info> pkgname=awwan-git -pkgver=0.10.0.r0.gf30f148 +pkgver=0.11.0.r2.g5e4e1d7 pkgrel=1 -pkgdesc="Configuration management software, infrastructure as file and directory layout." -arch=(x86_64) -url='https://git.sr.ht/~shulhan/awwan' +pkgdesc='Configuration management software, infrastructure as file and directory layout.' +arch=('any') +url='https://awwan.org' license=('GPL3') makedepends=( @@ -16,8 +16,13 @@ makedepends=( provides=('awwan') +## For testing in local. +#source=( +# "${pkgname}-local::git+file:///home/ms/go/src/git.sr.ht/~shulhan/awwan#branch=dev" +# "wui-local::git+file:///home/ms/src/wui" +#) source=( - "$pkgname::git+https://git.sr.ht/~shulhan/awwan" + "${pkgname}::git+https://git.sr.ht/~shulhan/awwan" "wui::git+https://git.sr.ht/~shulhan/wui" ) md5sums=( @@ -26,24 +31,26 @@ md5sums=( ) pkgver() { - cd "$pkgname" + cd "${pkgname}" git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' } prepare() { - cd "$pkgname" + cd "${pkgname}" git submodule init git config submodule."submodules/wui".url "${srcdir}/wui" git submodule update } build() { - cd "$pkgname" + cd "${pkgname}" make build } package() { - cd "$pkgname" - install -Dm755 _bin/awwan $pkgdir/usr/bin/awwan - install -Dm755 COPYING $pkgdir/usr/share/licenses/awwan/COPYING + cd "${pkgname}" + install -Dm755 _bin/awwan "${pkgdir}/usr/bin/awwan" + install -Dm755 COPYING "${pkgdir}/usr/share/licenses/awwan/COPYING" + install -Dm644 _sys/usr/share/bash-completion/completions/awwan \ + "${pkgdir}/usr/share/bash-completion/completions/awwan" } diff --git a/_sys/usr/share/bash-completion/completions/awwan b/_sys/usr/share/bash-completion/completions/awwan new file mode 100644 index 0000000..40c8c80 --- /dev/null +++ b/_sys/usr/share/bash-completion/completions/awwan @@ -0,0 +1,49 @@ +#/usr/bin/env bash +## SPDX-FileCopyrightText: 2024 Shulhan <ms@kilabit.info> +## SPDX-License-Identifier: GPL-3.0-or-later + +_awwan_completions() +{ + local commands=("decrypt" "encrypt" "env-get" "env-set" "help" + "local" "play" "serve" "version") + + local len=${#COMP_WORDS[@]} + local cmd=${COMP_WORDS[1]} + local key=${COMP_WORDS[2]} + + case "$cmd" in + decrypt) + COMPREPLY=($(compgen -A file -X "?(.git|*.log)" -- "$key")) + ;; + encrypt) + COMPREPLY=($(compgen -A file -X "?(.git|*.log)" -- "$key")) + ;; + env-get) + ;; + env-set) + ;; + help) + ;; + local) + COMPREPLY=($(compgen -A file -X "?(*.log|.*)" -- "$key")) + ;; + play) + COMPREPLY=($(compgen -A file -X "?(*.log|.*)" -- "$key")) + ;; + serve) + COMPREPLY=($(compgen -A directory -- "$key")) + ;; + version) + ;; + *) + if [[ -z $cmd ]]; then + COMPREPLY=("${commands[@]}") + else + local list="${commands[@]}" + COMPREPLY=($(compgen -W "$list" -- "$cmd")) + fi + ;; + esac +} + +complete -o bashdefault -F _awwan_completions awwan |
