mirror of
https://github.com/moghtech/komodo.git
synced 2026-03-11 17:44:19 -05:00
18 lines
343 B
Rust
18 lines
343 B
Rust
use std::io::Read;
|
|
|
|
use anyhow::Context;
|
|
use colored::Colorize;
|
|
|
|
pub fn wait_for_enter(press_enter_to: &str) -> anyhow::Result<()> {
|
|
println!(
|
|
"\nPress {} to {}\n",
|
|
"ENTER".green(),
|
|
press_enter_to.bold()
|
|
);
|
|
let buffer = &mut [0u8];
|
|
std::io::stdin()
|
|
.read_exact(buffer)
|
|
.context("failed to read ENTER")?;
|
|
Ok(())
|
|
}
|