command-listener
its a simple command listener without any specifics
default commands:
- exit -> stops the listener
- list -> lists all commands
usage:
use command_listener::{Command, Listener};
fn main() {
println!("Hello, command-listener!");
let test_command = Command::from(
String::from("test"),
String::from("this is a test command"),
|| {
println!("This is a test command!");
}
);
let mut listener = Listener::new();
listener.add_command(test_command);
listener.listen();
}