Move browser code to core crate

This commit is contained in:
John Doty 2022-12-17 08:48:57 -08:00
parent 9cf0089e48
commit d6c9ae8d71
5 changed files with 32 additions and 15 deletions

View file

@ -3,15 +3,17 @@
#[tokio::main]
async fn main() {
let args: Vec<String> = std::env::args().collect();
if args.len() != 2 {
eprintln!("Usage: fwd <server>");
std::process::exit(1);
}
let remote = &args[1];
if remote == "--server" {
if args.len() == 2 && &args[1] == "--server" {
fwd::run_server().await;
} else if args.len() == 3 && args[1] == "browse" {
fwd::browse_url(&args[2]).await;
} else {
fwd::run_client(remote).await;
if args.len() < 2 {
eprintln!("Usage: fwd <server>");
std::process::exit(1);
}
fwd::run_client(&args[1]).await;
}
}