2025-01-11 19:49:16 +09:00
|
|
|
#![feature(iter_intersperse)]
|
|
|
|
|
|
2025-01-08 18:31:59 +09:00
|
|
|
fn main() {
|
2025-01-11 19:49:16 +09:00
|
|
|
let cmd = std::env::args()
|
|
|
|
|
.skip(1)
|
|
|
|
|
.intersperse(" ".to_string())
|
|
|
|
|
.collect::<String>();
|
|
|
|
|
if !cmd.is_empty() {
|
2025-01-11 22:38:29 +09:00
|
|
|
use commands::CommandResult;
|
|
|
|
|
let parsed = commands::parse_command("pk;".to_string(), cmd);
|
|
|
|
|
match parsed {
|
|
|
|
|
CommandResult::Ok { command } => println!("{command:#?}"),
|
|
|
|
|
CommandResult::Err { error } => println!("{error}"),
|
|
|
|
|
}
|
2025-01-11 19:49:16 +09:00
|
|
|
} else {
|
2025-01-21 04:31:03 +09:00
|
|
|
for command in command_definitions::all() {
|
2025-01-21 00:39:25 +09:00
|
|
|
println!("{} - {}", command, command.help);
|
2025-01-11 19:49:16 +09:00
|
|
|
}
|
2025-01-08 18:31:59 +09:00
|
|
|
}
|
|
|
|
|
}
|