creddy/src-tauri/src/main.rs

29 lines
590 B
Rust
Raw Normal View History

#![cfg_attr(
all(not(debug_assertions), target_os = "windows"),
windows_subsystem = "windows"
)]
2023-05-15 20:09:26 +00:00
use creddy::{
app,
cli,
errors::ErrorPopup,
};
2023-04-30 17:52:46 +00:00
fn main() {
let res = match cli::parser().get_matches().subcommand() {
None | Some(("run", _)) => {
app::run().error_popup("Creddy failed to start");
Ok(())
},
Some(("get", m)) => cli::get(m),
Some(("exec", m)) => cli::exec(m),
_ => unreachable!(),
};
if let Err(e) = res {
eprintln!("Error: {e}");
std::process::exit(1);
}
}