Fix sq cert lint.

- If there are no certificate designators, we add one for stdin.

  - Do this before we inspect the certificate designators.
This commit is contained in:
Neal H. Walfield 2024-11-20 13:34:29 +01:00
parent 5cc0115b9c
commit e9155823e7
No known key found for this signature in database
GPG Key ID: 6863C9AD5B4D22D3

View File

@ -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.