Period date separator can now be used in the input file.

This commit is contained in:
scoobybejesus 2019-10-06 15:10:06 -04:00
parent 7002923a4c
commit 3e4ff26e22
3 changed files with 6 additions and 4 deletions

View File

@ -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,

View File

@ -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;

View File

@ -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;