[pbs-devel] [PATCH proxmox-backup 2/5] add proxmox-tape zsh-completions

Dominik Csapak d.csapak at proxmox.com
Wed Mar 3 15:00:50 CET 2021


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 debian/proxmox-backup-server.install |  1 +
 zsh-completions/_proxmox-tape        | 13 +++++++++++++
 2 files changed, 14 insertions(+)
 create mode 100644 zsh-completions/_proxmox-tape

diff --git a/debian/proxmox-backup-server.install b/debian/proxmox-backup-server.install
index 28df7756..cebf84a3 100644
--- a/debian/proxmox-backup-server.install
+++ b/debian/proxmox-backup-server.install
@@ -32,5 +32,6 @@ usr/share/man/man5/media-pool.cfg.5
 usr/share/man/man5/tape.cfg.5
 usr/share/man/man5/tape-job.cfg.5
 usr/share/zsh/vendor-completions/_proxmox-backup-manager
+usr/share/zsh/vendor-completions/_proxmox-tape
 usr/share/zsh/vendor-completions/_pmtx
 usr/share/zsh/vendor-completions/_pmt
diff --git a/zsh-completions/_proxmox-tape b/zsh-completions/_proxmox-tape
new file mode 100644
index 00000000..d1490c85
--- /dev/null
+++ b/zsh-completions/_proxmox-tape
@@ -0,0 +1,13 @@
+#compdef _proxmox-tape() proxmox-tape
+
+function _proxmox-tape() {
+    local cwords line point cmd curr prev
+    cworkds=${#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-tape bashcomplete "$cmd" "$curr" "$prev")
+}
-- 
2.20.1






More information about the pbs-devel mailing list