From fbf8779388c7e226e49e8344e04e9f917d0eedab Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sat, 6 Feb 2021 16:50:56 +0100 Subject: [PATCH] doc: improve pmt/pmtx manual pages --- docs/pmt/description.rst | 3 --- docs/pmt/man1.rst | 12 ++++++++++-- docs/pmtx/description.rst | 3 --- docs/pmtx/man1.rst | 31 ++++++++++++++++++++++++++++++- src/bin/pmtx.rs | 1 + 5 files changed, 41 insertions(+), 9 deletions(-) diff --git a/docs/pmt/description.rst b/docs/pmt/description.rst index dd95145d..fffc459d 100644 --- a/docs/pmt/description.rst +++ b/docs/pmt/description.rst @@ -1,5 +1,2 @@ -Description -^^^^^^^^^^^ - The ``pmt`` command controls Linux tape devices. diff --git a/docs/pmt/man1.rst b/docs/pmt/man1.rst index 428c26d2..8b5a68dc 100644 --- a/docs/pmt/man1.rst +++ b/docs/pmt/man1.rst @@ -29,8 +29,8 @@ All command supports the following parameters to specify the tape device: --drive Use drive from Proxmox Backup Server configuration. -Commands generation output supports the ``--output-format`` parameter. It accepts -the following values: +Commands generating output supports the ``--output-format`` +parameter. It accepts the following values: :``text``: Text format (default). Human readable. @@ -45,4 +45,12 @@ Description .. include:: description.rst +ENVIRONMENT +=========== + +:TAPE: If set, replaces the `--device` option. + +:PROXMOX_TAPE_DRIVE: If set, replaces the `--drive` option. + + .. include:: ../pbs-copyright.rst diff --git a/docs/pmtx/description.rst b/docs/pmtx/description.rst index e71c48f8..f5f32361 100644 --- a/docs/pmtx/description.rst +++ b/docs/pmtx/description.rst @@ -1,6 +1,3 @@ -Description -^^^^^^^^^^^ - The ``pmtx`` command controls SCSI media changer devices (tape autoloader). diff --git a/docs/pmtx/man1.rst b/docs/pmtx/man1.rst index d2b2542a..ce52dd7c 100644 --- a/docs/pmtx/man1.rst +++ b/docs/pmtx/man1.rst @@ -18,11 +18,40 @@ Synopsis .. include:: synopsis.rst + +Common Options +============== + +All command supports the following parameters to specify the changer device: + +--device Path to Linux generic SCSI device (e.g. '/dev/sg4') + +--changer Use changer from Proxmox Backup Server configuration. + + +Commands generating 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 +ENVIRONMENT +=========== +:CHANGER: If set, replaces the `--device` option + +:PROXMOX_TAPE_DRIVE: If set, use the Proxmox Backup Server + configuration to find the associcated changer device. + + +.. include:: ../pbs-copyright.rst diff --git a/src/bin/pmtx.rs b/src/bin/pmtx.rs index 0023e3ac..85114811 100644 --- a/src/bin/pmtx.rs +++ b/src/bin/pmtx.rs @@ -436,6 +436,7 @@ fn main() -> Result<(), Error> { let cmd_def = CliCommandMap::new() + .usage_skip_options(&["device", "changer", "output-format"]) .insert( "inquiry", CliCommand::new(&API_METHOD_INQUIRY)