diff --git a/libimagentryselect/src/ui.rs b/libimagentryselect/src/ui.rs index c8c524d5..a8d2d9df 100644 --- a/libimagentryselect/src/ui.rs +++ b/libimagentryselect/src/ui.rs @@ -31,8 +31,13 @@ pub fn get_id(matches: &ArgMatches) -> Option> { .map(|vals| { vals.into_iter() .map(String::from) - .map(StoreId::from) - .collect() + .map(PathBuf::from) + .map(|p| StoreId::new_baseless(p)) /* TODO: Do not hide error here */ + .filter_map(|res| match res { + Err(e) => { trace_error(&e); None }, + Ok(o) => Some(o), + }) + .collect() }) } @@ -46,7 +51,15 @@ pub fn get_or_select_id(matches: &ArgMatches, store_path: &PathBuf) -> Option Some(vec![StoreId::from(p)]), + Ok(p) => { + match StoreId::new_baseless(p) { + Err(e) => { + trace_error(&e); + None + }, + Ok(id) => Some(vec![id]), + } + }, } }) }