From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 1A6E698895 for ; Mon, 9 Oct 2023 13:52:19 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 404B016CF7 for ; Mon, 9 Oct 2023 13:52:17 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 9 Oct 2023 13:52:14 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id D66374493E for ; Mon, 9 Oct 2023 13:52:13 +0200 (CEST) From: Christian Ebner To: pbs-devel@lists.proxmox.com Date: Mon, 9 Oct 2023 13:51:39 +0200 Message-Id: <20231009115139.1417886-24-c.ebner@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009115139.1417886-1-c.ebner@proxmox.com> References: <20231009115139.1417886-1-c.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.080 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [RFC v2 proxmox-backup 23/23] test-suite: Add bin to deb, add shell completions X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2023 11:52:19 -0000 Adds the required files for bash and zsh completion and packages the binary to be included in the proxmox-backup-client debian package. Signed-off-by: Christian Ebner --- Changes since version 1: not present in version 1 Makefile | 13 ++++++++----- debian/proxmox-backup-client.bash-completion | 1 + debian/proxmox-backup-client.install | 2 ++ debian/proxmox-backup-test-suite.bc | 8 ++++++++ zsh-completions/_proxmox-backup-test-suite | 13 +++++++++++++ 5 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 debian/proxmox-backup-test-suite.bc create mode 100644 zsh-completions/_proxmox-backup-test-suite diff --git a/Makefile b/Makefile index 0317dd5e..acaac3f7 100644 --- a/Makefile +++ b/Makefile @@ -8,11 +8,12 @@ SUBDIRS := etc www docs # Binaries usable by users USR_BIN := \ - proxmox-backup-client \ - proxmox-file-restore \ - pxar \ - proxmox-tape \ - pmtx \ + proxmox-backup-client \ + proxmox-backup-test-suite \ + proxmox-file-restore \ + pxar \ + proxmox-tape \ + pmtx \ pmt # Binaries usable by admins @@ -165,6 +166,8 @@ $(COMPILED_BINS) $(COMPILEDIR)/dump-catalog-shell-cli $(COMPILEDIR)/docgen: .do- --bin proxmox-backup-client \ --bin dump-catalog-shell-cli \ --bin proxmox-backup-debug \ + --package proxmox-backup-test-suite \ + --bin proxmox-backup-test-suite \ --package proxmox-file-restore \ --bin proxmox-file-restore \ --package pxar-bin \ diff --git a/debian/proxmox-backup-client.bash-completion b/debian/proxmox-backup-client.bash-completion index 43736017..c4ff02ae 100644 --- a/debian/proxmox-backup-client.bash-completion +++ b/debian/proxmox-backup-client.bash-completion @@ -1,2 +1,3 @@ debian/proxmox-backup-client.bc proxmox-backup-client +debian/proxmox-backup-test-suite.bc proxmox-backup-test-suite debian/pxar.bc pxar diff --git a/debian/proxmox-backup-client.install b/debian/proxmox-backup-client.install index 74b568f1..0eb85975 100644 --- a/debian/proxmox-backup-client.install +++ b/debian/proxmox-backup-client.install @@ -1,6 +1,8 @@ usr/bin/proxmox-backup-client +usr/bin/proxmox-backup-test-suite usr/bin/pxar usr/share/man/man1/proxmox-backup-client.1 usr/share/man/man1/pxar.1 usr/share/zsh/vendor-completions/_proxmox-backup-client +usr/share/zsh/vendor-completions/_proxmox-backup-test-suite usr/share/zsh/vendor-completions/_pxar diff --git a/debian/proxmox-backup-test-suite.bc b/debian/proxmox-backup-test-suite.bc new file mode 100644 index 00000000..2686d7ea --- /dev/null +++ b/debian/proxmox-backup-test-suite.bc @@ -0,0 +1,8 @@ +# proxmox-backup-test-suite bash completion + +# see http://tiswww.case.edu/php/chet/bash/FAQ +# and __ltrim_colon_completions() in /usr/share/bash-completion/bash_completion +# this modifies global var, but I found no better way +COMP_WORDBREAKS=${COMP_WORDBREAKS//:} + +complete -C 'proxmox-backup-test-suite bashcomplete' proxmox-backup-test-suite diff --git a/zsh-completions/_proxmox-backup-test-suite b/zsh-completions/_proxmox-backup-test-suite new file mode 100644 index 00000000..72ebcea5 --- /dev/null +++ b/zsh-completions/_proxmox-backup-test-suite @@ -0,0 +1,13 @@ +#compdef _proxmox-backup-test-suite() proxmox-backup-test-suite + +function _proxmox-backup-test-suite() { + local cwords line point cmd curr prev + cwords=${#words[@]} + line=$words + point=${#line} + cmd=${words[1]} + curr=${words[cwords]} + prev=${words[cwords-1]} + compadd -- $(COMP_CWORD="$cwords" COMP_LINE="$line" COMP_POINT="$point" \ + proxmox-backup-test-suite bashcomplete "$cmd" "$curr" "$prev") +} -- 2.39.2