"use USER scope");
ap.parse_args()?;
mem::drop(ap);
- /*
mainopts.scope.get_or_insert_with(||{
let user = env::var("USER").unwrap_or_else(|e|{
// want to call ap.error but we have to drop it because
// otherwise it still has mainopts.scope borrowed
- ap.error(
+ eprintln!("bad usage: --scope-unix needs USER env var: {}", &e);
+ exit(12);
+ });
+ ManagementScope::Unix { user }
});
- */
<Result<_,i32>>::Ok(mainopts)
/*
Cell::from_mut(&mut mainopts.scope);
let opts = MainOpts::from_args();
*/
- })().unwrap_or_else(|rc| std::process::exit(if rc!=0 { 12 } else { 0 }));
+ })().unwrap_or_else(|rc| exit(if rc!=0 { 12 } else { 0 }));
println!("{:?}", &mainopts);
}