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.

22 lines
400 B

use std::env;
use std::process::exit;
pub fn schematics_main(run: &dyn 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,
});
}