diff --git a/src/cli/network/dane.rs b/src/cli/network/dane.rs index edf758f5..6965df57 100644 --- a/src/cli/network/dane.rs +++ b/src/cli/network/dane.rs @@ -108,13 +108,6 @@ pub struct GenerateCommand { help = "Change the emitted resource record type", )] pub typ: ResourceRecordType, - - #[clap( - long = "skip", - help = "Skip expired certificates and those that do not have \ - User IDs for given domain.", - )] - pub skip: bool, } #[derive(clap::ValueEnum, Clone, Copy, Debug, Default, PartialEq, Eq)] diff --git a/src/commands/network.rs b/src/commands/network.rs index ce962e9f..f74e53c1 100644 --- a/src/commands/network.rs +++ b/src/commands/network.rs @@ -1409,33 +1409,18 @@ pub fn dispatch_dane(mut sq: Sq, c: cli::network::dane::Command) } for cert in certs { - let vc = match cert.with_policy(sq.policy, sq.time) { - Ok(vc) => vc, - e @ Err(_) if ! c.skip => e?, - _ => continue, - }; + let vc = cert.with_policy(sq.policy, sq.time)?; use cli::network::dane::ResourceRecordType; - let r = match c.typ { + let records = match c.typ { ResourceRecordType::OpenPGP => - dane::generate(&vc, &c.domain, c.ttl, c.size_limit), + dane::generate(&vc, &c.domain, c.ttl, c.size_limit)?, ResourceRecordType::Generic => dane::generate_generic(&vc, &c.domain, c.ttl, - c.size_limit), + c.size_limit)?, }; - match r { - Ok(records) => - records.iter().for_each(|r| println!("{}", r)), - Err(e) => - match e.downcast::() { - // Ignore cert with no user ID in domain. - Ok(openpgp::Error::InvalidArgument(_)) - if c.skip => (), - Ok(e) => Err(e)?, - Err(e) => Err(e)?, - }, - } + records.iter().for_each(|r| println!("{}", r)); } }, Search(c) => rt.block_on(async {