summaryrefslogtreecommitdiff
path: root/src/cli.rs
diff options
context:
space:
mode:
authorHermes Agent <hermes@localhost>2026-08-12 01:34:51 +0000
committerHermes Agent <hermes@localhost>2026-08-12 01:34:51 +0000
commit9acf451473989fa868e21d2d6ff59cf3fb445562 (patch)
treec58417401e1ecb7304c21c2ebf6f2eaa032ad907 /src/cli.rs
parent020fbf6a034b3c90de1bdd3ee5e3e5e15c783059 (diff)
Add semantic artifact manifest comparison
Diffstat (limited to 'src/cli.rs')
-rw-r--r--src/cli.rs20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/cli.rs b/src/cli.rs
index c91d4fd..1b62cd9 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -3,6 +3,8 @@ use std::path::PathBuf;
use anyhow::{bail, Result};
use clap::{Parser, Subcommand};
+use crate::compare::compare;
+use crate::manifest::ArtifactManifest;
use crate::{BuildPlan, ImageSpec};
#[derive(Debug, Parser)]
@@ -56,7 +58,21 @@ pub fn run(cli: Cli) -> Result<()> {
Ok(())
}
Command::Build { .. } => bail!("build execution is not available yet"),
- Command::Inspect { .. } => bail!("artifact inspection is not available yet"),
- Command::Compare { .. } => bail!("artifact comparison is not available yet"),
+ Command::Inspect { artifact } => {
+ let manifest = ArtifactManifest::load(&artifact)?;
+ println!("{}", toml::to_string_pretty(&manifest)?);
+ Ok(())
+ }
+ Command::Compare { left, right } => {
+ let left = ArtifactManifest::load(&left)?;
+ let right = ArtifactManifest::load(&right)?;
+ let report = compare(&left, &right);
+ print!("{}", report.render());
+ if report.is_equivalent() {
+ Ok(())
+ } else {
+ bail!("artifacts differ semantically")
+ }
+ }
}
}