2025-05-02 20:35:45 +02:00
|
|
|
use osdb::branding::startup_msg;
|
|
|
|
|
use osdb::cli::read_input;
|
|
|
|
|
use osdb::command::Command;
|
|
|
|
|
use osdb::meta_commands::MetaCommand;
|
2025-05-01 22:19:24 +02:00
|
|
|
|
2025-05-01 19:24:18 +02:00
|
|
|
fn main() {
|
2025-05-01 21:00:28 +02:00
|
|
|
startup_msg();
|
|
|
|
|
while let Some(input) = read_input() {
|
|
|
|
|
match input.parse() {
|
|
|
|
|
Ok(cmd) => match cmd {
|
2025-05-01 22:19:24 +02:00
|
|
|
Command::MetaCommand(cmd) => match cmd {
|
|
|
|
|
MetaCommand::Exit => {
|
|
|
|
|
println!("Good-bye");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
},
|
2025-05-02 20:35:45 +02:00
|
|
|
Command::Statement(stmt) => stmt.execute(),
|
2025-05-01 21:00:28 +02:00
|
|
|
},
|
|
|
|
|
Err(err) => eprintln!("{err}"),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|