21 lines
527 B
Rust
21 lines
527 B
Rust
#[cfg(target_os = "freebsd")]
|
|
mod native;
|
|
#[cfg(target_os = "freebsd")]
|
|
mod root;
|
|
#[cfg(target_os = "freebsd")]
|
|
fn main() -> anyhow::Result<()> {
|
|
match std::env::args().nth(1).as_deref() {
|
|
Some("--root-helper") => root::serve(),
|
|
Some("--root-capabilities") => {
|
|
println!("{}", serde_json::to_string(&root::caps()?)?);
|
|
Ok(())
|
|
}
|
|
_ => native::main(),
|
|
}
|
|
}
|
|
#[cfg(not(target_os = "freebsd"))]
|
|
fn main() {
|
|
eprintln!("FreeBSD required");
|
|
std::process::exit(1);
|
|
}
|