install pmt binary

This commit is contained in:
Dietmar Maurer 2021-02-05 11:12:52 +01:00
parent 8dc45e291a
commit 4c209d6b10
9 changed files with 85 additions and 1 deletions

View File

@ -10,7 +10,8 @@ SUBDIRS := etc www docs
USR_BIN := \
proxmox-backup-client \
pxar \
pmtx
pmtx \
pmt
# Binaries usable by admins
USR_SBIN := \

3
debian/pmt.bc vendored Normal file
View File

@ -0,0 +1,3 @@
# pmt bash completion
complete -C 'pmt bashcomplete' pmt

View File

@ -1,2 +1,3 @@
debian/proxmox-backup-manager.bc proxmox-backup-manager
debian/pmtx.bc pmtx
debian/pmt.bc pmt

View 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

View 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

5
docs/pmt/description.rst Normal file
View File

@ -0,0 +1,5 @@
Description
^^^^^^^^^^^
The ``pmt`` command controls Linux tape devices.

48
docs/pmt/man1.rst Normal file
View File

@ -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

View 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"]))

13
zsh-completions/_pmt Normal file
View File

@ -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")
}