dive_reporter/
lib.rs

1#![allow(warnings)]
2
3mod common;
4mod parser;
5mod dive;
6mod stats;
7mod app;
8
9use std::error::Error;
10
11use stats::Stats;
12use app::App;
13
14
15pub struct Config {
16    pub path: String,
17}
18
19impl Config {
20    pub fn build(mut args: impl Iterator<Item = String>) -> Result<Config, &'static str> {
21        args.next();
22        let path = match args.next() {
23            Some(arg) => arg,
24            // None => return Err("Path missing"),
25            None => "".to_owned()
26        };
27        Ok(Config {
28            path,
29        })
30    }
31}
32
33pub fn run(config: Config) -> Result<(), Box<dyn Error>> {
34    App::default().init();
35    // let stats = Stats::new().from_path(&config.path)?;
36    // stats.print();
37    Ok(())
38}