Adding message if file was missing yet -a was set.

This commit is contained in:
scoobybejesus 2019-10-12 14:42:04 -04:00
parent dc38f9d195
commit dd34449763
2 changed files with 7 additions and 3 deletions

View File

@ -19,14 +19,18 @@ use crate::core_functions::InventoryCostingMethod;
use crate::string_utils;
pub fn choose_file_for_import() -> Result<PathBuf, Box<dyn Error>> {
pub fn choose_file_for_import(flag_to_accept_cli_args: bool) -> Result<PathBuf, Box<dyn Error>> {
if flag_to_accept_cli_args {
println!("\nWARN: Flag to 'accept args' was set, but 'file' is missing.\n");
}
println!("Please input a file (absolute or relative path) to import: ");
let (file_string, has_tilde) = _get_path()?;
if has_tilde {
choose_file_for_import()
choose_file_for_import(flag_to_accept_cli_args)
} else {
Ok( PathBuf::from(file_string) )
}

View File

@ -32,7 +32,7 @@ pub (crate) fn run_setup(args: super::Cli) -> Result<(PathBuf, ImportProcessPara
let input_file_path = match args.file_to_import {
Some(file) => file,
None => cli_user_choices::choose_file_for_import()?
None => cli_user_choices::choose_file_for_import(args.flags.accept_args)?
};
let wizard_or_not_args = ArgsForImportVarsTBD {