From 271ccc76ad22436b7e0d5291168a5d18c57bb77b Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 12 Aug 2026 01:59:47 +0000 Subject: Compare semantic facts directly from tar artifacts --- src/cli.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/cli.rs') diff --git a/src/cli.rs b/src/cli.rs index 1b62cd9..4445f20 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -59,13 +59,13 @@ pub fn run(cli: Cli) -> Result<()> { } Command::Build { .. } => bail!("build execution is not available yet"), Command::Inspect { artifact } => { - let manifest = ArtifactManifest::load(&artifact)?; + let manifest = load_artifact(&artifact)?; println!("{}", toml::to_string_pretty(&manifest)?); Ok(()) } Command::Compare { left, right } => { - let left = ArtifactManifest::load(&left)?; - let right = ArtifactManifest::load(&right)?; + let left = load_artifact(&left)?; + let right = load_artifact(&right)?; let report = compare(&left, &right); print!("{}", report.render()); if report.is_equivalent() { @@ -76,3 +76,10 @@ pub fn run(cli: Cli) -> Result<()> { } } } + +fn load_artifact(path: &std::path::Path) -> Result { + match path.extension().and_then(|extension| extension.to_str()) { + Some("toml") => ArtifactManifest::load(path), + _ => ArtifactManifest::collect_archive(path), + } +} -- cgit v1.2.3