feat: add message-io

This commit is contained in:
2021-02-11 00:27:09 +08:00
parent 03c5919538
commit bf7b9275c1
6 changed files with 606 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
#[macro_use] extern crate rust_util;
mod common;
mod client;
mod server;
pub fn main() {
let args: Vec<String> = std::env::args().collect();
match args.get(1).unwrap_or(&String::new()).as_ref() {
"client" => match args.get(2) {
Some(name) => client::run(name),
None => failure!("The client needs a 'name'"),
},
"server" => server::run(),
_ => information!("Usage: basic client | server"),
}
}