mirror of
https://github.com/Astatin3/unshell.git
synced 2026-06-08 22:38:01 -06:00
Get dynamic component loading working
This commit is contained in:
+30
-24
@@ -5,31 +5,37 @@ use unshell_lib::Announcement;
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let mut serverruntime = unshell_lib::server::ListenerRuntime::new();
|
||||
|
||||
loop {
|
||||
print!("> ");
|
||||
stdout().flush().expect("Failed to flush stdout");
|
||||
let mut input = String::new();
|
||||
stdin().read_line(&mut input).expect("Failed to read line");
|
||||
// loop {
|
||||
// print!("> ");
|
||||
// stdout().flush().expect("Failed to flush stdout");
|
||||
// let mut input = String::new();
|
||||
// stdin().read_line(&mut input).expect("Failed to read line");
|
||||
|
||||
let args = input.trim().split(" ").collect::<Vec<&str>>();
|
||||
// let args = input.trim().split(" ").collect::<Vec<&str>>();
|
||||
|
||||
match args[0] {
|
||||
"" => {}
|
||||
"test" => {
|
||||
if let Some(arg) = args.get(1) {
|
||||
println!("Test with argument: {}", arg);
|
||||
serverruntime
|
||||
.send(&Announcement::TestAnnouncement(arg.to_string()))
|
||||
.unwrap();
|
||||
} else {
|
||||
println!("Test without argument");
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
println!("Invalid Command: '{}'", args[0]);
|
||||
}
|
||||
}
|
||||
// match args[0] {
|
||||
// "" => {}
|
||||
// "test" => {
|
||||
// if let Some(arg) = args.get(1) {
|
||||
// println!("Test with argument: {}", arg);
|
||||
// serverruntime
|
||||
// .send(&Announcement::TestAnnouncement(arg.to_string()))
|
||||
// .unwrap();
|
||||
// } else {
|
||||
// println!("Test without argument");
|
||||
// }
|
||||
// }
|
||||
// _ => {
|
||||
// println!("Invalid Command: '{}'", args[0]);
|
||||
// }
|
||||
// }
|
||||
|
||||
// println!("{:?}", args);
|
||||
}
|
||||
// // println!("{:?}", args);
|
||||
// }
|
||||
|
||||
serverruntime.send(&Announcement::GetRuntimes)?;
|
||||
|
||||
// let response = serverruntime.
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user