pub fn select_environments(
prompt: &str,
items: &[String],
defaults: &[String],
no_color: bool,
) -> Result<Vec<String>>Expand description
Performs a multi-selection with fuzzy filtering by environment names.
Similar to select_packages but specialized for environments.
§Arguments
prompt- The prompt message to displayitems- The list of environment names to choose fromdefaults- Environment names to pre-selectno_color- Whether to disable colored output
§Returns
Result<Vec<String>>- The selected environment names
§Errors
Returns CliError::User if:
- User cancels the prompt (Ctrl+C)
- Terminal interaction fails
Returns CliError::Validation if:
- No items are selected
§Examples
use sublime_cli_tools::interactive::select::select_environments;
let envs = vec!["dev".to_string(), "staging".to_string(), "prod".to_string()];
let defaults = vec!["staging".to_string(), "prod".to_string()];
let selected = select_environments("Select environments", &envs, &defaults, false)?;