MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / prompt_yes_no

Function prompt_yes_no

crates/opencode-cli/src/main.rs:2625–2634  ·  view source on GitHub ↗
(question: &str)

Source from the content-addressed store, hash-verified

2623}
2624
2625fn prompt_yes_no(question: &str) -> anyhow::Result<bool> {
2626 print!("{} [y/N]: ", question);
2627 io::stdout().flush()?;
2628 let mut line = String::new();
2629 io::stdin().read_line(&mut line)?;
2630 Ok(matches!(
2631 line.trim().to_ascii_lowercase().as_str(),
2632 "y" | "yes"
2633 ))
2634}
2635
2636async fn handle_upgrade_command(
2637 target: Option<String>,

Callers 1

handle_upgrade_commandFunction · 0.85

Calls 1

newFunction · 0.85

Tested by

no test coverage detected