pub trait Prompter {
// Required methods
fn select_mode(&self) -> Result<CliMode, PawError>;
fn select_branches(
&self,
branches: &[String],
) -> Result<Vec<String>, PawError>;
fn select_cli(
&self,
clis: &[CliInfo],
default: Option<&str>,
) -> Result<String, PawError>;
fn select_cli_for_branch(
&self,
branch: &str,
clis: &[CliInfo],
) -> Result<String, PawError>;
}Expand description
Abstraction over interactive prompts, allowing test doubles.
Required Methods§
Sourcefn select_mode(&self) -> Result<CliMode, PawError>
fn select_mode(&self) -> Result<CliMode, PawError>
Ask the user to choose between uniform and per-branch CLI assignment.
Sourcefn select_branches(&self, branches: &[String]) -> Result<Vec<String>, PawError>
fn select_branches(&self, branches: &[String]) -> Result<Vec<String>, PawError>
Ask the user to pick one or more branches. Returns selected branch names.
Sourcefn select_cli(
&self,
clis: &[CliInfo],
default: Option<&str>,
) -> Result<String, PawError>
fn select_cli( &self, clis: &[CliInfo], default: Option<&str>, ) -> Result<String, PawError>
Ask the user to pick a single CLI for all branches. Returns binary name.
When default is Some and matches a CLI’s binary_name, that entry
is pre-selected in the picker. Otherwise the first item is selected.