pub fn get_item_from_cli_args_or_select<'a, CAS, O, OBA, OF>(
cli_args: &'a [String],
cli_arg_selector: CAS,
items: Vec<O>,
item_find_by_arg: OBA,
) -> Result<Option<O>>Expand description
Returns an item derived from CLI args or asks the user to select one.
Priority order:
- Tries to find the first CLI arg (by predicate) mapping to an existing item via
item_find_by_arg. - Falls back to interactive selection (
minimal_select).
ยงErrors
- A CLI argument matches predicate but no corresponding item is found.
- The interactive selection fails (see
minimal_select).