From 6ac3f65b36d374d908d0de96d0015db1cc020bc5 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Wed, 20 Jan 2021 09:00:25 +0100 Subject: sq: Make generated documentation wrap nicely on most displays. --- sq/build.rs | 2 +- sq/src/sq-usage.rs | 210 ++++++++++++++++++++++++++++++++++------------------- sq/src/sq_cli.rs | 6 +- 3 files changed, 143 insertions(+), 75 deletions(-) diff --git a/sq/build.rs b/sq/build.rs index 2a09a1e0..3711838b 100644 --- a/sq/build.rs +++ b/sq/build.rs @@ -13,7 +13,7 @@ fn main() { // XXX: Revisit once // https://github.com/rust-lang/rust/issues/44732 is stabilized. - let mut sq = sq_cli::build(); + let mut sq = sq_cli::configure(clap::App::new("sq").set_term_width(80)); let mut main = fs::File::create("src/sq-usage.rs").unwrap(); dump_help(&mut main, &mut sq, diff --git a/sq/src/sq-usage.rs b/sq/src/sq-usage.rs index a8de24b2..40368991 100644 --- a/sq/src/sq-usage.rs +++ b/sq/src/sq-usage.rs @@ -14,9 +14,10 @@ //! -V, --version Prints version information //! //! OPTIONS: -//! --known-notation ... The notation name is considered known. This is used when validating -//! signatures. Signatures that have unknown notations with the critical bit set -//! are considered invalid. +//! --known-notation ... +//! The notation name is considered known. This is used when validating +//! signatures. Signatures that have unknown notations with the critical +//! bit set are considered invalid. //! -p, --policy Sets the network policy to use //! //! SUBCOMMANDS: @@ -30,7 +31,8 @@ //! certring Manipulates certificate rings //! dearmor Removes ASCII Armor from a file //! enarmor Applies ASCII Armor to a file -//! help Prints this message or the help of the given subcommand(s) +//! help Prints this message or the help of the given +//! subcommand(s) //! inspect Inspects a sequence of OpenPGP packets //! key Manipulates keys //! packet OpenPGP Packet manipulation @@ -54,10 +56,15 @@ //! //! OPTIONS: //! -o, --output Sets the output file to use -//! --recipient-key ... Secret key to decrypt with, given as a file (can be given multiple times) -//! --signer-cert ... The signer's certificate to verify signatures with, given as a file (can be given -//! multiple times) -//! -n, --signatures The number of valid signatures required. Default: 0 +//! --recipient-key ... +//! Secret key to decrypt with, given as a file (can be given multiple +//! times) +//! --signer-cert ... +//! The signer's certificate to verify signatures with, given as a file +//! (can be given multiple times) +//! -n, --signatures +//! The number of valid signatures required. Default: 0 +//! //! //! ARGS: //! Sets the input file to use @@ -74,23 +81,33 @@ //! FLAGS: //! -B, --binary Don't ASCII-armor encode the OpenPGP data //! -h, --help Prints help information -//! -s, --symmetric Encrypt with a password (can be given multiple times) -//! --use-expired-subkey If a certificate has only expired encryption-capable subkeys, fall back to using the one -//! that expired last +//! -s, --symmetric Encrypt with a password (can be given multiple +//! times) +//! --use-expired-subkey If a certificate has only expired encryption- +//! capable subkeys, fall back to using +//! the one that expired last //! -V, --version Prints version information //! //! OPTIONS: -//! --compression Selects compression scheme to use [default: pad] [possible values: none, -//! pad, zip, zlib, bzip2] -//! --mode Selects what kind of keys are considered for encryption. Transport select -//! subkeys marked as suitable for transport encryption, rest selects those for -//! encrypting data at rest, and all selects all encryption-capable subkeys -//! [default: all] [possible values: transport, rest, all] +//! --compression +//! Selects compression scheme to use [default: pad] [possible values: +//! none, pad, zip, zlib, bzip2] +//! --mode +//! Selects what kind of keys are considered for encryption. Transport +//! select subkeys marked as suitable for transport encryption, rest +//! selects those for encrypting data at rest, and all selects all +//! encryption-capable subkeys [default: all] [possible values: +//! transport, rest, all] //! -o, --output Sets the output file to use -//! --recipient-cert ... Recipients to encrypt for, given as a file (can be given multiple times) -//! --signer-key ... Secret key to sign with, given as a file (can be given multiple times) -//! -t, --time