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 9BE7EBC364 for ; Thu, 28 Mar 2024 13:38:44 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id DF113A10B for ; Thu, 28 Mar 2024 13:37:52 +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 ; Thu, 28 Mar 2024 13:37:50 +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 A5A0E42978 for ; Thu, 28 Mar 2024 13:37:50 +0100 (CET) From: Christian Ebner To: pbs-devel@lists.proxmox.com Date: Thu, 28 Mar 2024 13:37:07 +0100 Message-Id: <20240328123707.336951-59-c.ebner@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240328123707.336951-1-c.ebner@proxmox.com> References: <20240328123707.336951-1-c.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.029 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] [PATCH v3 proxmox-backup 58/58] 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: Thu, 28 Mar 2024 12:38:44 -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 - might be not applied/dropped in future version and picked up later 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 0317dd5e8..acaac3f78 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 437360175..c4ff02ae6 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 74b568f17..0eb859757 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 000000000..2686d7eaa --- /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 000000000..72ebcea5f --- /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