diff options
| author | Hermes Agent <hermes@localhost> | 2026-08-12 01:59:47 +0000 |
|---|---|---|
| committer | Hermes Agent <hermes@localhost> | 2026-08-12 01:59:47 +0000 |
| commit | 271ccc76ad22436b7e0d5291168a5d18c57bb77b (patch) | |
| tree | f5404caa27fc4e6e8470847d74ec8001c2c84948 /src/cli.rs | |
| parent | 04c6c5af37d9eac00a2bba2eaba1ec0836834633 (diff) | |
Compare semantic facts directly from tar artifacts
Diffstat (limited to 'src/cli.rs')
| -rw-r--r-- | src/cli.rs | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -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<ArtifactManifest> { + match path.extension().and_then(|extension| extension.to_str()) { + Some("toml") => ArtifactManifest::load(path), + _ => ArtifactManifest::collect_archive(path), + } +} |