From f81a5912ebaa976f70542f808e30523c73c2cb41 Mon Sep 17 00:00:00 2001 From: bartvanbenthem Date: Tue, 4 Jul 2023 16:34:13 +0200 Subject: [PATCH] upd yaml --- src/main.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 6c52a3d..204e557 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,6 +17,7 @@ struct Config { template_file: String, output_file: String, json_file: String, + yaml_file: String, } fn main() -> Result<(), Box> { @@ -78,18 +79,27 @@ fn get_args() -> Result> { ) .arg( Arg::with_name("variables_json") - .short("v") - .long("variables") + .short("j") + .long("variables-json") .required(false) .takes_value(true) .help("Path to the JSON file"), ) + .arg( + Arg::with_name("variables_yaml") + .short("y") + .long("variables-yaml") + .required(false) + .takes_value(true) + .help("Path to the YAML file"), + ) .get_matches(); Ok(Config { template_file: matches.value_of("template_file").unwrap().to_string(), output_file: matches.value_of("output_file").unwrap_or("").to_string(), json_file: matches.value_of("variables_json").unwrap_or("").to_string(), + yaml_file: matches.value_of("variables_yaml").unwrap_or("").to_string(), }) }