Files
wfassoc/wfassoc-exec/src/main.rs

38 lines
928 B
Rust
Raw Normal View History

2025-10-17 14:19:26 +08:00
pub(crate) mod manifest;
2025-12-30 23:21:01 +08:00
pub(crate) mod cli;
pub(crate) mod runner;
2025-10-17 14:19:26 +08:00
2025-12-30 23:21:01 +08:00
use std::path::Path;
2025-10-18 09:55:08 +08:00
use std::process;
2025-10-09 13:53:31 +08:00
use thiserror::Error as TeError;
/// All errors occurs in this executable.
#[derive(TeError, Debug)]
enum Error {
2025-10-17 14:19:26 +08:00
/// Error when parsing manifest TOML file.
2025-12-30 23:21:01 +08:00
#[error("{0}")]
2026-04-17 15:24:22 +08:00
ParseManifest(#[from] manifest::ParseManifestError),
/// Error when parsing manifest into schema.
#[error("{0}")]
ParseSchema(#[from] manifest::ParseSchemaError),
2025-10-09 13:53:31 +08:00
}
/// Result type used in this executable.
type Result<T> = std::result::Result<T, Error>;
2025-12-30 23:21:01 +08:00
fn runner() -> Result<()> {
2026-04-17 15:24:22 +08:00
let mf = manifest::Manifest::from_file(Path::new(r#"D:\Repo\wfassoc\example\manifest\ppic.toml"#))?;
2025-12-30 23:21:01 +08:00
//let mf = raw_mf.to_checked()?;
2026-04-17 15:24:22 +08:00
println!("{:?}", mf);
2025-10-09 13:53:31 +08:00
Ok(())
2025-10-05 18:04:20 +08:00
}
fn main() {
2026-04-17 15:24:22 +08:00
//let cli = cli::parse();
2025-10-05 18:04:20 +08:00
2025-12-30 23:21:01 +08:00
runner().unwrap_or_else(|e| {
2025-10-05 18:04:20 +08:00
eprintln!("Runtime error: {}.", e);
process::exit(1)
});
}