add argument parser + parse config arg, Fixes #5
All checks were successful
CI/CD Pipeline / test (push) Successful in 1m49s
All checks were successful
CI/CD Pipeline / test (push) Successful in 1m49s
This commit is contained in:
14
src/main.rs
14
src/main.rs
@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user