summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYixun Lan <dlan@gentoo.org>2024-04-12 12:02:39 +0000
committerYixun Lan <dlan@gentoo.org>2024-04-12 12:12:08 +0000
commit34a779aec12874226594dcda3cc8a2500a6cc999 (patch)
treeaf6f9ec20173b2ee0c95f51bfe4132aa4b8bd07f /dev-vcs/git-absorb
parentdev-vcs/git-absorb: drop 0.6.10 (diff)
downloadgentoo-34a779aec12874226594dcda3cc8a2500a6cc999.tar.gz
gentoo-34a779aec12874226594dcda3cc8a2500a6cc999.tar.bz2
gentoo-34a779aec12874226594dcda3cc8a2500a6cc999.zip
dev-vcs/git-absorb: add completion script
Signed-off-by: Yixun Lan <dlan@gentoo.org>
Diffstat (limited to 'dev-vcs/git-absorb')
-rw-r--r--dev-vcs/git-absorb/git-absorb-0.6.11-r1.ebuild (renamed from dev-vcs/git-absorb/git-absorb-0.6.11.ebuild)31
1 files changed, 27 insertions, 4 deletions
diff --git a/dev-vcs/git-absorb/git-absorb-0.6.11.ebuild b/dev-vcs/git-absorb/git-absorb-0.6.11-r1.ebuild
index 7e47516fd076..ae2ac7412a63 100644
--- a/dev-vcs/git-absorb/git-absorb-0.6.11.ebuild
+++ b/dev-vcs/git-absorb/git-absorb-0.6.11-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2023 Gentoo Authors
+# Copyright 2023-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Autogenerated by pycargoebuild 0.6.3
@@ -76,14 +76,16 @@ CRATES="
winapi-x86_64-pc-windows-gnu-0.4.0
"
-inherit cargo
+inherit cargo shell-completion
DESCRIPTION="Automatically absorb staged changes into git current branch"
HOMEPAGE="https://github.com/tummychow/git-absorb"
-SRC_URI="$(cargo_crate_uris)"
+SRC_URI="${CARGO_CRATE_URIS}"
SRC_URI+=" https://github.com/tummychow/${PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
-LICENSE="Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD BSD-2 CC0-1.0 MIT MPL-2.0 Unlicense ZLIB"
+LICENSE="BSD"
+# Dependent crate licenses
+LICENSE+=" MIT Unicode-DFS-2016"
SLOT="0"
KEYWORDS="~amd64 ~arm64"
@@ -91,8 +93,29 @@ DOCS=( README.md )
QA_FLAGS_IGNORED="usr/bin/${PN}"
+src_compile() {
+ cargo_src_compile
+
+ GIT_ABSORB_BIN="target/$(usex debug debug release)/${PN}"
+
+ # Prepare shell completion generation
+ mkdir completions || die
+ local shell
+ for shell in bash fish zsh; do
+ "${GIT_ABSORB_BIN}" --gen-completions \
+ ${shell} \
+ > completions/${PN}.${shell} \
+ || die
+ done
+}
+
src_install() {
cargo_src_install
doman Documentation/${PN}.1
+
+ newbashcomp "completions/${PN}.bash" "${PN}"
+ dofishcomp "completions/${PN}.fish"
+ dozshcomp "completions/${PN}.zsh"
+
default
}