Get dynamic component loading working

This commit is contained in:
Michael Mikovsky
2025-11-14 09:43:41 -07:00
parent cc2b2960e8
commit f34ac017ce
13 changed files with 119 additions and 82 deletions
+30 -24
View File
@@ -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(())
}