]> git.proxmox.com Git - proxmox-backup.git/commitdiff
install pmt binary
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 5 Feb 2021 10:12:52 +0000 (11:12 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 5 Feb 2021 11:42:20 +0000 (12:42 +0100)
Makefile
debian/pmt.bc [new file with mode: 0644]
debian/proxmox-backup-server.bash-completion
debian/proxmox-backup-server.install
docs/Makefile
docs/pmt/description.rst [new file with mode: 0644]
docs/pmt/man1.rst [new file with mode: 0644]
src/bin/pmt.rs
zsh-completions/_pmt [new file with mode: 0644]

index ea0a1a5e58935c3da0e8f6aaef96acfa8145c4a2..b2ef9d32decfd36f54b37752a700ddbb05d35149 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,8 @@ SUBDIRS := etc www docs
 USR_BIN := \
        proxmox-backup-client   \
        pxar                    \
-       pmtx
+       pmtx                    \
+       pmt
 
 # Binaries usable by admins
 USR_SBIN := \
diff --git a/debian/pmt.bc b/debian/pmt.bc
new file mode 100644 (file)
index 0000000..cb32b33
--- /dev/null
@@ -0,0 +1,3 @@
+# pmt bash completion
+
+complete -C 'pmt bashcomplete' pmt
index 712677c185cf849137f4ce3b3cf1a939175f7850..06d74f1c68a4d08a0cd577bbc765196c786b4e38 100644 (file)
@@ -1,2 +1,3 @@
 debian/proxmox-backup-manager.bc proxmox-backup-manager
 debian/pmtx.bc pmtx
+debian/pmt.bc pmt
index c53e09fac500a69ed9d74251f177b444a0c004ee..8f877e251194d490def02ae596fcfb86a5ff6e95 100644 (file)
@@ -11,6 +11,7 @@ usr/lib/x86_64-linux-gnu/proxmox-backup/proxmox-daily-update
 usr/lib/x86_64-linux-gnu/proxmox-backup/sg-tape-cmd
 usr/sbin/proxmox-backup-manager
 usr/bin/pmtx
+usr/bin/pmt
 usr/share/javascript/proxmox-backup/index.hbs
 usr/share/javascript/proxmox-backup/css/ext6-pbs.css
 usr/share/javascript/proxmox-backup/images
@@ -18,5 +19,7 @@ usr/share/javascript/proxmox-backup/js/proxmox-backup-gui.js
 usr/share/man/man1/proxmox-backup-manager.1
 usr/share/man/man1/proxmox-backup-proxy.1
 usr/share/man/man1/pmtx.1
+usr/share/man/man1/pmt.1
 usr/share/zsh/vendor-completions/_proxmox-backup-manager
 usr/share/zsh/vendor-completions/_pmtx
+usr/share/zsh/vendor-completions/_pmt
index 06bdadb9ddabc40d0c7d5c829ad12cd84ad2f9bb..c80cc0787d6a4e9dcf48ed4a8a371fb3ef5d2715 100644 (file)
@@ -6,12 +6,14 @@ GENERATED_SYNOPSIS :=                                                 \
        proxmox-backup-manager/synopsis.rst                     \
        pxar/synopsis.rst                                       \
        pmtx/synopsis.rst                                       \
+       pmt/synopsis.rst                                        \
        backup-protocol-api.rst                                 \
        reader-protocol-api.rst
 
 MANUAL_PAGES :=                        \
        pxar.1                          \
        pmtx.1                          \
+       pmt.1                           \
        proxmox-backup-proxy.1          \
        proxmox-backup-client.1         \
        proxmox-backup-manager.1
@@ -77,6 +79,13 @@ pmtx.1: pmtx/man1.rst  pmtx/description.rst pmtx/synopsis.rst
        rst2man $< >$@
 
 
+pmt/synopsis.rst: ${COMPILEDIR}/pmt
+       ${COMPILEDIR}/pmt printdoc > pmt/synopsis.rst
+
+pmt.1: pmt/man1.rst  pmt/description.rst pmt/synopsis.rst
+       rst2man $< >$@
+
+
 proxmox-backup-client/synopsis.rst: ${COMPILEDIR}/proxmox-backup-client
        ${COMPILEDIR}/proxmox-backup-client printdoc > proxmox-backup-client/synopsis.rst
 
diff --git a/docs/pmt/description.rst b/docs/pmt/description.rst
new file mode 100644 (file)
index 0000000..dd95145
--- /dev/null
@@ -0,0 +1,5 @@
+Description
+^^^^^^^^^^^
+
+The ``pmt`` command controls Linux tape devices.
+
diff --git a/docs/pmt/man1.rst b/docs/pmt/man1.rst
new file mode 100644 (file)
index 0000000..428c26d
--- /dev/null
@@ -0,0 +1,48 @@
+==========================
+pmt
+==========================
+
+.. include:: ../epilog.rst
+
+-------------------------------------------------------------
+Control Linux Tape Devices
+-------------------------------------------------------------
+
+:Author: |AUTHOR|
+:Version: Version |VERSION|
+:Manual section: 1
+
+
+Synopsis
+========
+
+.. include:: synopsis.rst
+
+
+Common Options
+==============
+
+All command supports the following parameters to specify the tape device:
+
+--device <path>  Path to the Linux tape device
+
+--drive <name>  Use drive from Proxmox Backup Server configuration.
+
+
+Commands generation output supports the ``--output-format`` parameter. It accepts
+the following values:
+
+:``text``: Text format (default). Human readable.
+
+:``json``: JSON (single line).
+
+:``json-pretty``: JSON (multiple lines, nicely formatted).
+
+
+Description
+===========
+
+.. include:: description.rst
+
+
+.. include:: ../pbs-copyright.rst
index 13bb057c57cb7627cdc0d93c3de6fb32df12169a..c6389f3800ce747794ba350da69605fd6b0426a4 100644 (file)
@@ -922,6 +922,7 @@ fn main() -> Result<(), Error> {
     };
 
     let cmd_def = CliCommandMap::new()
+        .usage_skip_options(&["device", "drive", "output-format"])
         .insert("asf", std_cmd(&API_METHOD_ASF).arg_param(&["count"]))
         .insert("bsf", std_cmd(&API_METHOD_BSF).arg_param(&["count"]))
         .insert("bsfm", std_cmd(&API_METHOD_BSFM).arg_param(&["count"]))
diff --git a/zsh-completions/_pmt b/zsh-completions/_pmt
new file mode 100644 (file)
index 0000000..dc418df
--- /dev/null
@@ -0,0 +1,13 @@
+#compdef _pmt() pmt
+
+function _pmt() {
+    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" \
+        pmt bashcomplete "$cmd" "$curr" "$prev")
+}