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 2F13D9EE4B for ; Fri, 3 Nov 2023 14:38:06 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2EC741E399 for ; Fri, 3 Nov 2023 14:38:05 +0100 (CET) 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 ; Fri, 3 Nov 2023 14:38:01 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 382614430C for ; Fri, 3 Nov 2023 14:38:01 +0100 (CET) From: Christian Ebner To: pbs-devel@lists.proxmox.com Date: Fri, 3 Nov 2023 14:37:28 +0100 Message-Id: <20231103133729.2252730-24-c.ebner@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231103133729.2252730-1-c.ebner@proxmox.com> References: <20231103133729.2252730-1-c.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.073 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 T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pbs-devel] [PATCH v3 proxmox-backup 23/24] 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: Fri, 03 Nov 2023 13:38:06 -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 2: - no changes 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