use std::{ env, process, sync::mpsc::channel, thread, }; fn main() { let mut args = env::args(); if args.len() < 2 { let args = args.collect::>(); println!("watch: version: {}", env!("CARGO_PKG_VERSION")); println!( "watch: usage: {} []...", args.get(0).map(|s| s.as_str()).unwrap_or("watch") ); process::exit(1); } let cmd = args.nth(1).unwrap(); let args = args.collect::>(); let (sender, receiver) = channel(); { let sender = sender.clone(); thread::spawn(move || meet::handle(sender, receiver, cmd, args)); } if let Err(_e) = meet::watch(sender) { process::exit(1); } }