From 6b608c55a6a64504a2220f485f193be5a534fb2c Mon Sep 17 00:00:00 2001 From: kralonur Date: Fri, 1 May 2026 04:01:36 +0300 Subject: [PATCH] Add shell completions --- .SRCINFO | 2 +- PKGBUILD | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index b29b3e3..7598313 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = foundry-bin pkgdesc = Blazing fast, portable and modular Ethereum development toolkit written in Rust pkgver = 1.7.0 - pkgrel = 1 + pkgrel = 2 url = https://github.com/foundry-rs/foundry arch = aarch64 arch = x86_64 diff --git a/PKGBUILD b/PKGBUILD index 1360267..6d16311 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,7 +2,7 @@ # Contributor: Peter Flynn pkgname=foundry-bin pkgver=1.7.0 -pkgrel=1 +pkgrel=2 pkgdesc="Blazing fast, portable and modular Ethereum development toolkit written in Rust" arch=('aarch64' 'x86_64') url="https://github.com/foundry-rs/foundry" @@ -26,4 +26,26 @@ package() { install -Dm755 cast "$pkgdir/usr/bin/cast" install -Dm755 anvil "$pkgdir/usr/bin/anvil" install -Dm755 chisel "$pkgdir/usr/bin/chisel" + + for _cmd in forge cast anvil; do + _install_completions "$_cmd" + done +} + +_install_completions() { + local _cmd="$1" + + "${pkgdir}/usr/bin/${_cmd}" completions bash > "${_cmd}.bash" + "${pkgdir}/usr/bin/${_cmd}" completions zsh > "${_cmd}.zsh" + "${pkgdir}/usr/bin/${_cmd}" completions fish > "${_cmd}.fish" + "${pkgdir}/usr/bin/${_cmd}" completions elvish > "${_cmd}.elvish" + "${pkgdir}/usr/bin/${_cmd}" completions powershell > "${_cmd}.ps1" + "${pkgdir}/usr/bin/${_cmd}" completions nushell > "${_cmd}.nu" + + install -Dm644 "${_cmd}.bash" "${pkgdir}/usr/share/bash-completion/completions/${_cmd}" + install -Dm644 "${_cmd}.zsh" "${pkgdir}/usr/share/zsh/site-functions/_${_cmd}" + install -Dm644 "${_cmd}.fish" "${pkgdir}/usr/share/fish/vendor_completions.d/${_cmd}.fish" + install -Dm644 "${_cmd}.elvish" "${pkgdir}/usr/share/elvish/lib/${_cmd}.elv" + install -Dm644 "${_cmd}.ps1" "${pkgdir}/usr/share/powershell/Completions/${_cmd}.ps1" + install -Dm644 "${_cmd}.nu" "${pkgdir}/usr/share/nushell/vendor/autoload/${_cmd}.nu" } -- 2.54.0