From 580615af2374ff08e38afcdeb4dff163e7538dc1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 28 Apr 2025 19:29:50 +0200 Subject: [PATCH] Generating bash-completion during build. Signed-off-by: Daniel Baumann --- debian/control | 1 + debian/rules | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 78be1ea..1d33db7 100644 --- a/debian/control +++ b/debian/control @@ -6,6 +6,7 @@ Build-Depends: debhelper-compat (= 13), dh-sequence-python3, python3-all, + python3-argcomplete, python3-setuptools, python3-yaml, Rules-Requires-Root: no diff --git a/debian/rules b/debian/rules index e3f484f..d31d0c4 100755 --- a/debian/rules +++ b/debian/rules @@ -10,7 +10,13 @@ execute_after_dh_auto_clean: execute_after_dh_auto_install: # bash-completion mkdir -p debian/gita/usr/share/bash-completion/completions - cp auto-completion/bash/.gita-completion.bash debian/gita/usr/share/bash-completion/completions/gita + + for COMMAND in debian/gita/usr/bin/*; \ + do \ + register-python-argcomplete $${COMMAND} | \ + sed -e 's|debian/gita/usr/bin/||g' > \ + debian/gita/usr/share/bash-completion/completions/$$(basename $${COMMAND}); \ + done override_dh_auto_test: # disabled