Hi,

The following diff makes devel/jujutsu to generate shell completions
files for bash, fish and zsh, and include them in the package.

I am just a bit unsure if the mv dance is necessary in post-build (like
for man page generation).

Comments or OK ?
-- 
Sebastien Marie

diff --git a/devel/jujutsu/Makefile b/devel/jujutsu/Makefile
index 00e2846d9c..f50490eba8 100644
--- a/devel/jujutsu/Makefile
+++ b/devel/jujutsu/Makefile
@@ -2,7 +2,7 @@
 
 V =                    0.25.0
 PKGNAME =              jujutsu-$V
-REVISION =             1
+REVISION =             2
 
 DIST_TUPLE =           github jj-vcs jj v$V .
 
@@ -30,9 +30,23 @@
 post-build:
        ${WRKBUILD}/target/release/jj util mangen > ${WRKBUILD}/jj.1.tmp
        mv ${WRKBUILD}/jj.1.tmp ${WRKBUILD}/jj.1
+       ${WRKBUILD}/target/release/jj util completion bash > ${WRKBUILD}/jj.bash
+       ${WRKBUILD}/target/release/jj util completion fish > ${WRKBUILD}/jj.fish
+       ${WRKBUILD}/target/release/jj util completion zsh > ${WRKBUILD}/jj.zsh
 
 post-install:
        ${INSTALL_MAN} ${WRKBUILD}/jj.1 ${PREFIX}/man/man1
+       ${INSTALL_DATA_DIR} \
+               ${PREFIX}/share/bash-completion/completions \
+               ${PREFIX}/share/fish/vendor_completions.d \
+               ${PREFIX}/share/zsh/site-functions
+       ${INSTALL_DATA} ${WRKBUILD}/jj.bash \
+               ${PREFIX}/share/bash-completion/completions/jj
+       ${INSTALL_DATA} ${WRKBUILD}/jj.fish \
+               ${PREFIX}/share/fish/vendor_completions.d/jj.fish
+       ${INSTALL_DATA} ${WRKBUILD}/jj.zsh \
+               ${PREFIX}/share/zsh/site-functions/_jj
+
 
 MODCARGO_INSTALL_TARGET_PATHS = cli
 
diff --git a/devel/jujutsu/pkg/PLIST b/devel/jujutsu/pkg/PLIST
index 827b217335..b06b8d8dce 100644
--- a/devel/jujutsu/pkg/PLIST
+++ b/devel/jujutsu/pkg/PLIST
@@ -1,2 +1,11 @@
 @bin bin/jj
 @man man/man1/jj.1
+share/bash-completion/
+share/bash-completion/completions/
+share/bash-completion/completions/jj
+share/fish/
+share/fish/vendor_completions.d/
+share/fish/vendor_completions.d/jj.fish
+share/zsh/
+share/zsh/site-functions/
+share/zsh/site-functions/_jj

Reply via email to