Skip to main content

Prompter

Trait Prompter 

Source
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>;
    fn select_specs(
        &self,
        specs: &[SpecEntry],
    ) -> Result<Vec<SpecEntry>, PawError>;
}
Expand description

Abstraction over interactive prompts, allowing test doubles.

Required Methods§

Source

fn select_mode(&self) -> Result<CliMode, PawError>

Ask the user to choose between uniform and per-branch CLI assignment.

Source

fn select_branches(&self, branches: &[String]) -> Result<Vec<String>, PawError>

Ask the user to pick one or more branches. Returns selected branch names.

Source

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.

Source

fn select_cli_for_branch( &self, branch: &str, clis: &[CliInfo], ) -> Result<String, PawError>

Ask the user to pick a CLI for a specific branch. Returns binary name.

Source

fn select_specs(&self, specs: &[SpecEntry]) -> Result<Vec<SpecEntry>, PawError>

Ask the user to pick one or more specs. Returns the selected SpecEntry values expanded from grouped logical units.

Each row in the picker represents one logical unit (a Spec Kit feature, an OpenSpec change, or a Markdown spec). Selecting a row returns every underlying SpecEntry belonging to that unit.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§