bc-envelope-cli 0.35.0

Gordian Envelope Command Line Tool.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use anyhow::Result;
use clap::Args;

use crate::read_envelope;

/// Print the count of the envelope's assertions.
#[derive(Debug, Args)]
#[group(skip)]
pub struct CommandArgs {
    envelope: Option<String>,
}

impl crate::Exec for CommandArgs {
    fn exec(&self) -> Result<String> {
        let envelope = read_envelope(self.envelope.as_deref())?;
        Ok(envelope.attachments()?.len().to_string())
    }
}