Files
Gen_Hack-and-Slash-Roguelite/Server/src/command_helper.rs

23 lines
488 B
Rust
Raw Normal View History

2025-07-10 18:26:15 +08:00
use std::io::Write;
pub(crate) fn run() {
let stdin = std::io::stdin();
loop {
print!("> ");
std::io::stdout()
.flush()
.expect("Failed to flush standard output!");
let mut input = String::new();
stdin
.read_line(&mut input)
.expect("Failed to read from standard input!");
match input.trim() {
"exit" => break,
_ => println!("Usage: <command>"),
}
}
}