Move browser code to core crate
This commit is contained in:
parent
9cf0089e48
commit
d6c9ae8d71
5 changed files with 32 additions and 15 deletions
16
src/main.rs
16
src/main.rs
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue