From e9155823e7cf6385769f20f3980cafb6e1b20ecc Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Wed, 20 Nov 2024 13:34:29 +0100 Subject: [PATCH] Fix sq cert lint. - If there are no certificate designators, we add one for stdin. - Do this before we inspect the certificate designators. --- src/commands/cert/lint.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/commands/cert/lint.rs b/src/commands/cert/lint.rs index 02162889..105cb6c7 100644 --- a/src/commands/cert/lint.rs +++ b/src/commands/cert/lint.rs @@ -230,6 +230,11 @@ pub fn lint(sq: Sq, mut args: Command) -> Result<()> { let reference_time = sq.time; + // If no inputs are given, read from stdin. + if args.certs.is_empty() { + args.certs.designators.push(CertDesignator::Stdin); + } + let mut out = if args.output.is_some() || args.certs.iter().any(|d| d.from_file() || d.from_stdin()) { @@ -250,11 +255,6 @@ pub fn lint(sq: Sq, mut args: Command) -> Result<()> { None }; - // If no inputs are given, read from stdin. - if args.certs.is_empty() { - args.certs.designators.push(CertDesignator::Stdin); - } - { 'next_cert: for cert in sq.resolve_certs_or_fail(&args.certs, 0)? { // Whether we found at least one issue.