use std::env; #[tokio::main] async fn main() { let args = env::args().collect::>(); match args.as_slice() { [_, cid, time_out_sec, proxy] => { let gateways = w3s::gateway::check_gateways_by_cid( cid, time_out_sec.parse::().ok(), Some(proxy), ) .await; println!("{:#?}", gateways); } [_, cid, time_out_sec] => { let gateways = w3s::gateway::check_gateways_by_cid(cid, time_out_sec.parse::().ok(), None) .await; println!("{:#?}", gateways); } _ => { let gateways = w3s::gateway::check_gateways(None).await; println!("{:#?}", gateways); } } }