keyfork/crates/util/keyfork-prompt/examples/test-basic-prompt.rs

16 lines
327 B
Rust
Raw Normal View History

2024-08-11 23:25:25 +00:00
#![allow(missing_docs)]
2024-01-16 02:44:48 +00:00
use keyfork_prompt::{
2025-01-30 17:10:36 +00:00
Message,
2025-01-04 05:30:41 +00:00
default_handler,
};
2024-01-07 04:23:41 +00:00
fn main() -> Result<(), Box<dyn std::error::Error>> {
2025-01-30 17:10:36 +00:00
let mut handler = default_handler()?;
2025-01-30 17:10:36 +00:00
let output = handler.prompt_input("Test message: ")?;
handler.prompt_message(Message::Text(format!("Result: {output}")))?;
Ok(())
}