summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2021-01-22 00:19:08 +0100
committerJustus Winter <justus@sequoia-pgp.org>2021-01-22 08:33:14 +0100
commit2e770949e3d1f5de46c3d4c38e6fdf70f07b9f1e (patch)
tree33306ee9a4039e0c795e7f9e64e9b1c389f83f54
parent035af448511f8a4bb5f9693b7b005fae5e9c8fdf (diff)
sq: Make key attest-certifications --all the default.
-rw-r--r--sq/src/commands/key.rs7
-rw-r--r--sq/src/sq-usage.rs2
-rw-r--r--sq/src/sq_cli.rs2
3 files changed, 7 insertions, 4 deletions
diff --git a/sq/src/commands/key.rs b/sq/src/commands/key.rs
index 25ec4ff5..acc5502f 100644
--- a/sq/src/commands/key.rs
+++ b/sq/src/commands/key.rs
@@ -413,6 +413,9 @@ pub fn attest_certifications(config: Config, m: &ArgMatches, _p: &dyn Policy)
const SubpacketTag__AttestedCertifications: SubpacketTag =
SubpacketTag::Unknown(37);
+ // Attest to all certifications?
+ let all = ! m.is_present("none"); // All is the default.
+
// Some configuration.
let hash_algo = HashAlgorithm::default();
let digest_size = hash_algo.context()?.digest_size();
@@ -445,7 +448,7 @@ pub fn attest_certifications(config: Config, m: &ArgMatches, _p: &dyn Policy)
for uid in key.userids() {
let mut attestations = Vec::new();
- if m.is_present("all") {
+ if all {
for certification in uid.certifications() {
let mut h = hash_algo.context()?;
hash_for_confirmation(certification, &mut h);
@@ -488,7 +491,7 @@ pub fn attest_certifications(config: Config, m: &ArgMatches, _p: &dyn Policy)
for ua in key.user_attributes() {
let mut attestations = Vec::new();
- if m.is_present("all") {
+ if all {
for certification in ua.certifications() {
let mut h = hash_algo.context()?;
hash_for_confirmation(certification, &mut h);
diff --git a/sq/src/sq-usage.rs b/sq/src/sq-usage.rs
index 5d5fe69b..8b2147df 100644
--- a/sq/src/sq-usage.rs
+++ b/sq/src/sq-usage.rs
@@ -280,7 +280,7 @@
//! sq key attest-certifications [FLAGS] [OPTIONS] [KEY]
//!
//! FLAGS:
-//! --all Attests to all certifications
+//! --all Attests to all certifications [default]
//! -B, --binary Emits binary data
//! -h, --help Prints help information
//! --none Removes all prior attestations
diff --git a/sq/src/sq_cli.rs b/sq/src/sq_cli.rs
index 2045b01f..d92c458a 100644
--- a/sq/src/sq_cli.rs
+++ b/sq/src/sq_cli.rs
@@ -412,7 +412,7 @@ pub fn configure(app: App<'static, 'static>) -> App<'static, 'static> {
.arg(Arg::with_name("all")
.long("all")
.conflicts_with("none")
- .help("Attests to all certifications"))
+ .help("Attests to all certifications [default]"))
.arg(Arg::with_name("key")
.value_name("KEY")
.help("Changes attestations on KEY"))