add argument parser + parse config arg, Fixes #5
All checks were successful
CI/CD Pipeline / test (push) Successful in 1m49s

This commit is contained in:
2024-02-15 08:48:26 +01:00
parent 5d9642dea9
commit c511e5a4d8
3 changed files with 65 additions and 4 deletions

View File

@ -1,11 +1,19 @@
use clap::{command, Parser};
use risp::law::Law;
#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
struct Args {
/// Path to the config of a law text
#[arg(short, long)]
config: String,
}
fn main() {
env_logger::init();
let config_path = "./data/configs/stgb.toml";
let law = Law::from_config(config_path).unwrap();
let args = Args::parse();
let law = Law::from_config(&args.config).unwrap();
law.to_md();
}