From 3e4ff26e221239e4a539d31ec286484b1dc592a4 Mon Sep 17 00:00:00 2001 From: scoobybejesus Date: Sun, 6 Oct 2019 15:10:06 -0400 Subject: [PATCH] Period date separator can now be used in the input file. --- src/main.rs | 4 ++-- src/skip_wizard.rs | 3 ++- src/wizard.rs | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index ba050b8..0b38842 100644 --- a/src/main.rs +++ b/src/main.rs @@ -68,8 +68,8 @@ pub(crate) struct Flags { #[derive(StructOpt, Debug)] pub(crate) struct Options { - /// Choose "h" or "s" for hyphen or slash (i.e., "-" or "/") to indicate the separator character used - /// in the input file txDate column (i.e. 2017/12/31 or 2017-12-31). + /// Choose "h", "s", or "p" for hyphen, slash, or period (i.e., "-", "/", or ".") to indicate the separator + /// character used in the file_to_import txDate column (i.e. 2017/12/31, 2017-12-31, or 2017.12.31). #[structopt(name = "date separator character", short, long = "date-separator", default_value = "h", parse(from_os_str))] date_separator: OsString, diff --git a/src/skip_wizard.rs b/src/skip_wizard.rs index 40e5d26..705a6c8 100644 --- a/src/skip_wizard.rs +++ b/src/skip_wizard.rs @@ -23,7 +23,8 @@ pub(crate) fn skip_wizard(args: super::Cli) -> Result<( let date_separator = match args.opts.date_separator.into_string().unwrap().as_str() { "h" => {"-"} "s" => {"/"} - _ => { println!("\nFATAL: The date-separator arg requires either an 'h' or an 's'.\n"); process::exit(1) } + "p" => {"."} + _ => { println!("\nFATAL: The date-separator arg requires either an 'h', an 's', or a 'p'.\n"); process::exit(1) } }; let input_file_path; diff --git a/src/wizard.rs b/src/wizard.rs index 9fe6e35..856aa84 100644 --- a/src/wizard.rs +++ b/src/wizard.rs @@ -27,7 +27,8 @@ pub(crate) fn wizard(args: super::Cli) -> Result<( let date_separator = match args.opts.date_separator.into_string().unwrap().as_str() { "h" => {"-"} "s" => {"/"} - _ => { println!("\nFATAL: The date-separator arg requires either an 'h' or an 's'.\n"); process::exit(1) } + "p" => {"."} + _ => { println!("\nFATAL: The date-separator arg requires either an 'h', an 's', or a 'p'.\n"); process::exit(1) } }; let input_file_path;