Start with SchematicsFactory and bin
This commit is contained in:
parent
c91eb2f04e
commit
0bc56a8f69
8 changed files with 157 additions and 30 deletions
13
src/bin.rs
Normal file
13
src/bin.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
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 });
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue