Adding message if file was missing yet -a was set.
This commit is contained in:
parent
dc38f9d195
commit
dd34449763
|
@ -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) )
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue