36 lines
1.1 KiB
Rust
36 lines
1.1 KiB
Rust
fn main() {
|
|
let current_workspace = match std::env::current_dir() {
|
|
Ok(path) => path,
|
|
Err(error) => {
|
|
eprintln!("cannot determine current workspace: {error}");
|
|
std::process::exit(1);
|
|
}
|
|
};
|
|
let command =
|
|
match lazaret_client::parse_command_line(std::env::args_os().skip(1), current_workspace) {
|
|
Ok(command) => command,
|
|
Err(error) => {
|
|
eprintln!("invalid command line: {error}");
|
|
std::process::exit(2);
|
|
}
|
|
};
|
|
let mut backend = match lazaret_client::production::ProductionClientBackend::new() {
|
|
Ok(backend) => backend,
|
|
Err(error) => {
|
|
eprintln!("Lazaret failed: {error}");
|
|
std::process::exit(1);
|
|
}
|
|
};
|
|
match lazaret_client::run(
|
|
&mut backend,
|
|
&command,
|
|
&mut std::io::stdout(),
|
|
&mut std::io::stderr(),
|
|
) {
|
|
Ok(status) => std::process::exit(status),
|
|
Err(error) => {
|
|
eprintln!("Lazaret failed: {error}");
|
|
std::process::exit(1);
|
|
}
|
|
}
|
|
}
|