zsh_completion: add sogrep completions
Transform sogrep into an in-prog so we can benefit from the m4 macro to specify valid repos in a single place of truth. Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
This commit is contained in:
parent
f32a264796
commit
64b7d99504
|
@ -15,4 +15,5 @@ zsh_completion
|
|||
find-libdeps
|
||||
crossrepomove
|
||||
arch-nspawn
|
||||
sogrep
|
||||
doc/*.1
|
||||
|
|
4
Makefile
4
Makefile
|
@ -16,12 +16,12 @@ IN_PROGS = \
|
|||
crossrepomove\
|
||||
arch-nspawn \
|
||||
mkarchroot \
|
||||
makechrootpkg
|
||||
makechrootpkg \
|
||||
sogrep
|
||||
|
||||
BINPROGS = \
|
||||
$(IN_PROGS) \
|
||||
offload-build \
|
||||
sogrep
|
||||
|
||||
CONFIGFILES = \
|
||||
makepkg-x86_64.conf \
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
#!/hint/bash
|
||||
# License: Unspecified
|
||||
:
|
||||
|
||||
# shellcheck disable=2034
|
||||
_repos=(
|
||||
staging
|
||||
testing
|
||||
core
|
||||
extra
|
||||
community-staging
|
||||
community-testing
|
||||
community
|
||||
multilib-staging
|
||||
multilib-testing
|
||||
multilib
|
||||
gnome-unstable
|
||||
kde-unstable
|
||||
)
|
||||
|
||||
# shellcheck disable=2034
|
||||
_build_repos=(
|
||||
staging
|
||||
testing
|
||||
extra
|
||||
multilib-staging
|
||||
multilib-testing
|
||||
multilib
|
||||
gnome-unstable
|
||||
kde-unstable
|
||||
)
|
|
@ -21,10 +21,8 @@
|
|||
# globals
|
||||
: ${SOLINKS_MIRROR:="https://mirror.pkgbuild.com"}
|
||||
: ${SOCACHE_DIR:="${XDG_CACHE_HOME:-${HOME}/.cache}/sogrep"}
|
||||
repos=('staging' 'testing' 'core' 'extra'
|
||||
'community-staging' 'community-testing' 'community'
|
||||
'multilib-staging' 'multilib-testing' 'multilib'
|
||||
'gnome-unstable' 'kde-unstable')
|
||||
|
||||
m4_include(lib/valid-repos.sh)
|
||||
arches=('x86_64')
|
||||
|
||||
# options
|
||||
|
@ -39,7 +37,7 @@ recache() {
|
|||
|
||||
(( VERBOSE )) && verbosity=--progress-bar
|
||||
|
||||
for repo in "${repos[@]}"; do
|
||||
for repo in "${_repos[@]}"; do
|
||||
for arch in "${arches[@]}"; do
|
||||
rm -rf "${SOCACHE_DIR}/${arch}/${repo}"
|
||||
mkdir -p "${SOCACHE_DIR}/${arch}/${repo}"
|
||||
|
@ -49,10 +47,10 @@ recache() {
|
|||
}
|
||||
|
||||
search() {
|
||||
local repo=$1 arch lib=$2 srepos=("${repos[@]}")
|
||||
local repo=$1 arch lib=$2 srepos=("${_repos[@]}")
|
||||
|
||||
if [[ $repo != all ]]; then
|
||||
if ! in_array "${repo}" "${repos[@]}"; then
|
||||
if ! in_array "${repo}" "${_repos[@]}"; then
|
||||
echo "${BASH_SOURCE[0]##*/}: unrecognized repo '$repo'"
|
||||
echo "Try '${BASH_SOURCE[0]##*/} --help' for more information."
|
||||
exit 1
|
|
@ -1,7 +1,8 @@
|
|||
#compdef archbuild archco arch-nspawn archrelease commitpkg finddeps makechrootpkg mkarchroot rebuildpkgs extrapkg=commitpkg corepkg=commitpkg testingpkg=commitpkg stagingpkg=commitpkg communitypkg=commitpkg community-testingpkg=commitpkg community-stagingpkg=commitpkg multilibpkg=commitpkg multilib-testingpkg=commitpkg extra-x86_64-build=archbuild testing-x86_64-build=archbuild staging-x86_64-build=archbuild multilib-build=archbuild multilib-testing-build=archbuild multilib-staging-build=archbuild kde-unstable-x86_64-build=archbuild gnome-unstable-x86_64-build=archbuild communityco=archco checkpkg
|
||||
#compdef archbuild archco arch-nspawn archrelease commitpkg finddeps makechrootpkg mkarchroot rebuildpkgs extrapkg=commitpkg corepkg=commitpkg testingpkg=commitpkg stagingpkg=commitpkg communitypkg=commitpkg community-testingpkg=commitpkg community-stagingpkg=commitpkg multilibpkg=commitpkg multilib-testingpkg=commitpkg extra-x86_64-build=archbuild testing-x86_64-build=archbuild staging-x86_64-build=archbuild multilib-build=archbuild multilib-testing-build=archbuild multilib-staging-build=archbuild kde-unstable-x86_64-build=archbuild gnome-unstable-x86_64-build=archbuild communityco=archco checkpkg sogrep
|
||||
# License: Unspecified
|
||||
|
||||
m4_include(lib/valid-tags.sh)
|
||||
m4_include(lib/valid-repos.sh)
|
||||
|
||||
_archbuild_args=(
|
||||
'-c[Recreate the chroot before building]'
|
||||
|
@ -74,6 +75,14 @@ _checkpkg_args=(
|
|||
'(-h --help)'{-h,--help}'[Display usage]'
|
||||
)
|
||||
|
||||
_sogrep_args=(
|
||||
'(-v --verbose)'{-v,--verbose}'[Show matched links in addition to pkgname]'
|
||||
'(-r --refresh)'{-r,--refresh}'[Refresh the links databases]'
|
||||
'(-h --help)'{-h,--help}'[Display usage]'
|
||||
'1:repo:(all $_repos[*])'
|
||||
'2:libname'
|
||||
)
|
||||
|
||||
_devtools_completions_all_packages() {
|
||||
typeset -U packages
|
||||
packages=($(_call_program packages pacman -Sql))
|
||||
|
|
Loading…
Reference in New Issue