summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2021-01-21 08:12:39 +0100
committerJustus Winter <justus@sequoia-pgp.org>2021-01-21 08:12:39 +0100
commit71a4b4bafb558a58156e89051a3b19acfa682024 (patch)
tree243c1518d4ac7f200e521cc0cadb8d2cdeb15fe8
parent4a95182ed3efba3e6440cc310a77e2435883485c (diff)
sq: Disable --version flags for subcommands.
-rw-r--r--sq/src/sq-usage.rs35
-rw-r--r--sq/src/sq_cli.rs5
2 files changed, 13 insertions, 27 deletions
diff --git a/sq/src/sq-usage.rs b/sq/src/sq-usage.rs
index b0776543..c9fcd7de 100644
--- a/sq/src/sq-usage.rs
+++ b/sq/src/sq-usage.rs
@@ -56,7 +56,6 @@
//! --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 <KIND>
@@ -96,7 +95,6 @@
//! --dump-session-key Prints the session key to stderr
//! -h, --help Prints help information
//! -x, --hex Print a hexdump (implies --dump)
-//! -V, --version Prints version information
//!
//! OPTIONS:
//! -o, --output <FILE> Sets the output file to use
@@ -128,7 +126,6 @@
//! --detached Create a detached signature
//! -h, --help Prints help information
//! -n, --notarize Signs a message and all existing signatures
-//! -V, --version Prints version information
//!
//! OPTIONS:
//! -o, --output <FILE> Sets the output file to use
@@ -152,8 +149,7 @@
//! sq verify [OPTIONS] [--] [FILE]
//!
//! FLAGS:
-//! -h, --help Prints help information
-//! -V, --version Prints version information
+//! -h, --help Prints help information
//!
//! OPTIONS:
//! --detached <SIG> Verifies a detached signature
@@ -178,8 +174,7 @@
//! sq merge-signatures [OPTIONS] [ARGS]
//!
//! FLAGS:
-//! -h, --help Prints help information
-//! -V, --version Prints version information
+//! -h, --help Prints help information
//!
//! OPTIONS:
//! -o, --output <FILE> Sets the output file to use
@@ -198,8 +193,7 @@
//! sq key <SUBCOMMAND>
//!
//! FLAGS:
-//! -h, --help Prints help information
-//! -V, --version Prints version information
+//! -h, --help Prints help information
//!
//! SUBCOMMANDS:
//! adopt Bind keys from one certificate to another.
@@ -308,9 +302,6 @@
//! -h, --help
//! Prints help information
//!
-//! -V, --version
-//! Prints version information
-//!
//!
//! SUBCOMMANDS:
//! filter Joins certs into a certring applying a filter
@@ -429,8 +420,7 @@
//! sq autocrypt <SUBCOMMAND>
//!
//! FLAGS:
-//! -h, --help Prints help information
-//! -V, --version Prints version information
+//! -h, --help Prints help information
//!
//! SUBCOMMANDS:
//! decode Converts Autocrypt-encoded keys to OpenPGP Certificates
@@ -493,8 +483,7 @@
//! sq keyserver [OPTIONS] <SUBCOMMAND>
//!
//! FLAGS:
-//! -h, --help Prints help information
-//! -V, --version Prints version information
+//! -h, --help Prints help information
//!
//! OPTIONS:
//! -s, --server <URI> Sets the keyserver to use
@@ -551,8 +540,7 @@
//! sq wkd <SUBCOMMAND>
//!
//! FLAGS:
-//! -h, --help Prints help information
-//! -V, --version Prints version information
+//! -h, --help Prints help information
//!
//! SUBCOMMANDS:
//! generate Generates a Web Key Directory for the given domain and keys.
@@ -631,8 +619,7 @@
//! sq armor [OPTIONS] [FILE]
//!
//! FLAGS:
-//! -h, --help Prints help information
-//! -V, --version Prints version information
+//! -h, --help Prints help information
//!
//! OPTIONS:
//! --kind <KIND> Selects the kind of header line to produce [default:
@@ -653,8 +640,7 @@
//! sq dearmor [OPTIONS] [FILE]
//!
//! FLAGS:
-//! -h, --help Prints help information
-//! -V, --version Prints version information
+//! -h, --help Prints help information
//!
//! OPTIONS:
//! -o, --output <FILE> Sets the output file to use
@@ -674,7 +660,6 @@
//! FLAGS:
//! --certifications Print third-party certifications
//! -h, --help Prints help information
-//! -V, --version Prints version information
//!
//! ARGS:
//! <FILE> Sets the input file to use
@@ -689,8 +674,7 @@
//! sq packet <SUBCOMMAND>
//!
//! FLAGS:
-//! -h, --help Prints help information
-//! -V, --version Prints version information
+//! -h, --help Prints help information
//!
//! SUBCOMMANDS:
//! decrypt Decrypts an OpenPGP message, dumping the content of the
@@ -808,7 +792,6 @@
//! --non-revocable Marks the certification as being non-revocable. That
//! is, you cannot later revoke this certification. This
//! should normally only be used with an expiration.
-//! -V, --version Prints version information
//!
//! OPTIONS:
//! -a, --amount <TRUST_AMOUNT>
diff --git a/sq/src/sq_cli.rs b/sq/src/sq_cli.rs
index 8fc159eb..e432b980 100644
--- a/sq/src/sq_cli.rs
+++ b/sq/src/sq_cli.rs
@@ -20,7 +20,10 @@ pub fn configure(app: App<'static, 'static>) -> App<'static, 'static> {
let app = app
.version(env!("CARGO_PKG_VERSION"))
.about("Sequoia is an implementation of OpenPGP. This is a command-line frontend.")
- .setting(AppSettings::SubcommandRequiredElseHelp)
+ .settings(&[
+ AppSettings::SubcommandRequiredElseHelp,
+ AppSettings::VersionlessSubcommands,
+ ])
.arg(Arg::with_name("force")
.short("f").long("force")
.help("Overwrite existing files"))