CLI argument to start the server at startup

This commit is contained in:
2025-01-01 13:13:01 -05:00
parent b94ae4d586
commit 2c5084d317
3 changed files with 24 additions and 5 deletions
+5 -1
View File
@@ -22,7 +22,11 @@ mod window;
#[derive(Parser)]
struct Args {
/// The path to a virtual boy ROM to run.
rom: Option<PathBuf>,
/// Start a GDB/LLDB debug server on this port.
#[arg(short, long)]
debug_port: Option<u16>,
}
fn set_panic_handler() {
@@ -101,6 +105,6 @@ fn main() -> Result<()> {
let event_loop = EventLoop::with_user_event().build().unwrap();
event_loop.set_control_flow(ControlFlow::Poll);
let proxy = event_loop.create_proxy();
event_loop.run_app(&mut Application::new(client, proxy))?;
event_loop.run_app(&mut Application::new(client, proxy, args.debug_port))?;
Ok(())
}