Roc linker library base setup

This commit is contained in:
Brendan Hansknecht 2021-08-16 20:06:44 -07:00
parent d5058041b0
commit c6217ebfdb
10 changed files with 151 additions and 0 deletions

17
linker/src/main.rs Normal file
View file

@ -0,0 +1,17 @@
use roc_linker::{build_app, preprocess, CMD_PREPROCESS, CMD_SURGERY};
use std::io;
fn main() -> io::Result<()> {
let matches = build_app().get_matches();
let exit_code = match matches.subcommand_name() {
None => Ok::<i32, io::Error>(-1),
Some(CMD_PREPROCESS) => {
preprocess()?;
Ok(0)
}
Some(CMD_SURGERY) => Ok(0),
_ => unreachable!(),
}?;
std::process::exit(exit_code);
}