43 lines
1.1 KiB
Rust
43 lines
1.1 KiB
Rust
//! Command-line dispatch of `strata-next`: each group of commands owns its own match, in this order.
|
|
|
|
mod args;
|
|
mod kar_inspect;
|
|
mod kar_overlay;
|
|
mod kar_verify;
|
|
mod model_ensure;
|
|
mod model_fetch;
|
|
mod model_inspect;
|
|
mod model_prepare;
|
|
mod model_text;
|
|
mod operations;
|
|
mod report;
|
|
mod usage;
|
|
|
|
use strata_control::BoxError;
|
|
|
|
pub async fn run(args: &[String]) -> Result<(), BoxError> {
|
|
if operations::run(args).await?
|
|
|| run_model_files(args).await?
|
|
|| run_kar(args).await?
|
|
|| model_text::run(args).await?
|
|
{
|
|
return Ok(());
|
|
}
|
|
Err(usage::USAGE.into())
|
|
}
|
|
|
|
/// The `model` commands that fetch, inspect, ensure and prepare model files.
|
|
async fn run_model_files(args: &[String]) -> Result<bool, BoxError> {
|
|
Ok(model_fetch::run(args).await?
|
|
|| model_inspect::run(args).await?
|
|
|| model_ensure::run(args).await?
|
|
|| model_prepare::run(args).await?)
|
|
}
|
|
|
|
/// The `model` commands on KAR files: inspect, verify and overlay.
|
|
async fn run_kar(args: &[String]) -> Result<bool, BoxError> {
|
|
Ok(kar_inspect::run(args).await?
|
|
|| kar_verify::run(args).await?
|
|
|| kar_overlay::run(args).await?)
|
|
}
|