pub fn simple_select<T: ToString>(
prompt: &str,
items: &[T],
default: Option<usize>,
no_color: bool,
) -> Result<usize>Expand description
Performs a single selection without fuzzy search.
This is a simpler version for cases where fuzzy search is not needed.
§Arguments
prompt- The prompt message to displayitems- The list of items to choose fromdefault- Optional default selection indexno_color- Whether to disable colored output
§Returns
Result<usize>- The index of the selected item
§Errors
Returns CliError::User if:
- User cancels the prompt (Ctrl+C)
- Terminal interaction fails
§Examples
use sublime_cli_tools::interactive::select::simple_select;
let options = vec!["patch", "minor", "major"];
let selection = simple_select("Select bump type", &options, Some(0), false)?;