Skip to main content

oxi/
main_dispatch.rs

1//! Single-prompt helper shared by the binary entry and integration tests.
2//!
3//! Kept separate from `bootstrap.rs` because it is also called by tests.
4
5use crate::App;
6use anyhow::Result;
7
8/// Run a single prompt and print the response.
9pub async fn run_single_prompt(app: App, prompt: &str) -> Result<()> {
10    let response = app
11        .run_prompt_with_events(prompt.to_string(), |_event| {})
12        .await?;
13    println!("{response}");
14    Ok(())
15}