1
0
Files
wfassoc/wfassoc_exec/src/main.rs

35 lines
788 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}")]
2025-10-17 14:19:26 +08:00
Manifest(#[from] manifest::Error),
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<()> {
let raw_mf = manifest::RawManifest::from_file(Path::new(r#"D:\Repo\wfassoc\example\ppic.toml"#))?;
//let mf = raw_mf.to_checked()?;
println!("{:?}", raw_mf);
2025-10-09 13:53:31 +08:00
Ok(())
2025-10-05 18:04:20 +08:00
}
fn main() {
2025-12-30 23:21:01 +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)
});
}