A library for writing host-specific, single-binary configuration management and deployment tools
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
344 B

use std::process::exit;
use std::env;
pub fn schematics_main(run: &Fn (bool) -> Result<(), ()>) {
let args: Vec<String> = env::args().collect();
let dry_run = match args.len() {
1 => false,
2 => if args[1] == "--dry-run" { true } else { panic!() },
_ => panic!()
};
exit(match run(dry_run) { Ok(_) => 0, Err(_) => 1 });
}