osdb/src/main.rs

22 lines
579 B
Rust
Raw Normal View History

use osdb::branding::startup_msg;
use osdb::cli::read_input;
use osdb::command::Command;
use osdb::error_display::OSDBError as _;
2025-05-01 19:24:18 +02:00
fn main() {
println!("{}", startup_msg());
2025-05-01 21:00:28 +02:00
while let Some(input) = read_input() {
match input.parse::<Command>() {
Ok(cmd) => {
let result = cmd.execute();
println!("{}", result.display());
if result.should_exit {
break;
}
}
Err(err) => err.display("<stdin>", &input),
2025-05-01 21:00:28 +02:00
}
}
println!("Good-bye");
2025-05-01 21:00:28 +02:00
}