Period date separator can now be used in the input file.
This commit is contained in:
parent
7002923a4c
commit
3e4ff26e22
|
@ -68,8 +68,8 @@ pub(crate) struct Flags {
|
||||||
#[derive(StructOpt, Debug)]
|
#[derive(StructOpt, Debug)]
|
||||||
pub(crate) struct Options {
|
pub(crate) struct Options {
|
||||||
|
|
||||||
/// Choose "h" or "s" for hyphen or slash (i.e., "-" or "/") to indicate the separator character used
|
/// Choose "h", "s", or "p" for hyphen, slash, or period (i.e., "-", "/", or ".") to indicate the separator
|
||||||
/// in the input file txDate column (i.e. 2017/12/31 or 2017-12-31).
|
/// 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))]
|
#[structopt(name = "date separator character", short, long = "date-separator", default_value = "h", parse(from_os_str))]
|
||||||
date_separator: OsString,
|
date_separator: OsString,
|
||||||
|
|
||||||
|
|
|
@ -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() {
|
let date_separator = match args.opts.date_separator.into_string().unwrap().as_str() {
|
||||||
"h" => {"-"}
|
"h" => {"-"}
|
||||||
"s" => {"/"}
|
"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;
|
let input_file_path;
|
||||||
|
|
|
@ -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() {
|
let date_separator = match args.opts.date_separator.into_string().unwrap().as_str() {
|
||||||
"h" => {"-"}
|
"h" => {"-"}
|
||||||
"s" => {"/"}
|
"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;
|
let input_file_path;
|
||||||
|
|
Loading…
Reference in New Issue