diff options
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 04d0a96..b93d80f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,18 @@ mod config; +mod page; +use std::env; +use std::path::PathBuf; fn main() { + config::parse_file("ahsi.toml"); + let args: Vec<String> = env::args().collect(); + if args.len() > 1 { + let first_arg = &args[1]; + let path = PathBuf::from(first_arg); + match page::parse_page(&path) { + Ok(p) => println!("{}", p.html), + Err(e) => eprintln!("error: {e:#}"), + } + } } |
