From c972704477f1abfeca8ca3c0c1c9bc277e26310a Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 27 Jan 2021 11:31:26 +0100 Subject: [PATCH] install pmtx binary --- Makefile | 5 +- debian/pmtx.bc | 3 + debian/proxmox-backup-server.bash-completion | 1 + debian/proxmox-backup-server.install | 3 + docs/Makefile | 10 ++ docs/pmtx/description.rst | 6 + docs/pmtx/synopsis.rst | 122 +++++++++++++++++++ zsh-completions/_pmtx | 13 ++ 8 files changed, 161 insertions(+), 2 deletions(-) create mode 100644 debian/pmtx.bc create mode 100644 docs/pmtx/description.rst create mode 100644 docs/pmtx/synopsis.rst create mode 100644 zsh-completions/_pmtx diff --git a/Makefile b/Makefile index 3dbcba15..ea0a1a5e 100644 --- a/Makefile +++ b/Makefile @@ -8,8 +8,9 @@ SUBDIRS := etc www docs # Binaries usable by users USR_BIN := \ - proxmox-backup-client \ - pxar + proxmox-backup-client \ + pxar \ + pmtx # Binaries usable by admins USR_SBIN := \ diff --git a/debian/pmtx.bc b/debian/pmtx.bc new file mode 100644 index 00000000..e36202a2 --- /dev/null +++ b/debian/pmtx.bc @@ -0,0 +1,3 @@ +# pmtx bash completion + +complete -C 'pmtx bashcomplete' pmtx diff --git a/debian/proxmox-backup-server.bash-completion b/debian/proxmox-backup-server.bash-completion index 769bc66f..712677c1 100644 --- a/debian/proxmox-backup-server.bash-completion +++ b/debian/proxmox-backup-server.bash-completion @@ -1 +1,2 @@ debian/proxmox-backup-manager.bc proxmox-backup-manager +debian/pmtx.bc pmtx diff --git a/debian/proxmox-backup-server.install b/debian/proxmox-backup-server.install index a44569cd..c53e09fa 100644 --- a/debian/proxmox-backup-server.install +++ b/debian/proxmox-backup-server.install @@ -10,10 +10,13 @@ usr/lib/x86_64-linux-gnu/proxmox-backup/proxmox-backup-banner 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/share/javascript/proxmox-backup/index.hbs usr/share/javascript/proxmox-backup/css/ext6-pbs.css usr/share/javascript/proxmox-backup/images 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/zsh/vendor-completions/_proxmox-backup-manager +usr/share/zsh/vendor-completions/_pmtx diff --git a/docs/Makefile b/docs/Makefile index a6e8c988..06bdadb9 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -5,11 +5,13 @@ GENERATED_SYNOPSIS := \ proxmox-backup-client/catalog-shell-synopsis.rst \ proxmox-backup-manager/synopsis.rst \ pxar/synopsis.rst \ + pmtx/synopsis.rst \ backup-protocol-api.rst \ reader-protocol-api.rst MANUAL_PAGES := \ pxar.1 \ + pmtx.1 \ proxmox-backup-proxy.1 \ proxmox-backup-client.1 \ proxmox-backup-manager.1 @@ -67,6 +69,14 @@ pxar/synopsis.rst: ${COMPILEDIR}/pxar pxar.1: pxar/man1.rst pxar/description.rst pxar/synopsis.rst rst2man $< >$@ + +pmtx/synopsis.rst: ${COMPILEDIR}/pmtx + ${COMPILEDIR}/pmtx printdoc > pmtx/synopsis.rst + +pmtx.1: pmtx/man1.rst pmtx/description.rst pmtx/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/pmtx/description.rst b/docs/pmtx/description.rst new file mode 100644 index 00000000..e71c48f8 --- /dev/null +++ b/docs/pmtx/description.rst @@ -0,0 +1,6 @@ +Description +^^^^^^^^^^^ + +The ``pmtx`` command controls SCSI media changer devices (tape +autoloader). + diff --git a/docs/pmtx/synopsis.rst b/docs/pmtx/synopsis.rst new file mode 100644 index 00000000..939cacd0 --- /dev/null +++ b/docs/pmtx/synopsis.rst @@ -0,0 +1,122 @@ +``pmtx help [{}] [OPTIONS]`` + +Get help about specified command (or sub-command). + +:`` ``: Command. This may be a list in order to spefify nested sub-commands. + + +Optional parameters: + +:``--verbose ``: Verbose help. + + +---- + +``pmtx inquiry [OPTIONS]`` + +Inquiry + +Optional parameters: + +:``--changer ``: Tape Changer Identifier. + + +:``--device ``: Path to Linux generic SCSI device (e.g. '/dev/sg4') + + +:``--output-format ``: Output format. + + +---- + +``pmtx inventory [OPTIONS]`` + +Inventory + +Optional parameters: + +:``--changer ``: Tape Changer Identifier. + + +:``--device ``: Path to Linux generic SCSI device (e.g. '/dev/sg4') + + +---- + +``pmtx load [OPTIONS]`` + +Load + +:`` ``: Storage slot number (source). + + +Optional parameters: + +:``--changer ``: Tape Changer Identifier. + + +:``--device ``: Path to Linux generic SCSI device (e.g. '/dev/sg4') + + +:``--drivenum ``: Target drive number (defaults to Drive 0) + + +---- + +``pmtx status [OPTIONS]`` + +Changer Status + +Optional parameters: + +:``--changer ``: Tape Changer Identifier. + + +:``--device ``: Path to Linux generic SCSI device (e.g. '/dev/sg4') + + +:``--output-format ``: Output format. + + +---- + +``pmtx transfer [OPTIONS]`` + +Transfer + +:`` ``: Source storage slot number. + + +:`` ``: Target storage slot number. + + +Optional parameters: + +:``--changer ``: Tape Changer Identifier. + + +:``--device ``: Path to Linux generic SCSI device (e.g. '/dev/sg4') + + +---- + +``pmtx unload [OPTIONS]`` + +Unload + +Optional parameters: + +:``--changer ``: Tape Changer Identifier. + + +:``--device ``: Path to Linux generic SCSI device (e.g. '/dev/sg4') + + +:``--drivenum ``: Target drive number (defaults to Drive 0) + + +:``--slot ``: Storage slot number (target). If omitted, defaults to the slot that the drive + was loaded from. + + + diff --git a/zsh-completions/_pmtx b/zsh-completions/_pmtx new file mode 100644 index 00000000..7269e82e --- /dev/null +++ b/zsh-completions/_pmtx @@ -0,0 +1,13 @@ +#compdef _pmtx() pmtx + +function _pmtx() { + 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" \ + pmtx bashcomplete "$cmd" "$curr" "$prev") +}