creddy/src-tauri/src/main.rs

37 lines
653 B
Rust
Raw Normal View History

#![cfg_attr(
all(not(debug_assertions), target_os = "windows"),
windows_subsystem = "windows"
)]
mod app;
mod cli;
mod config;
mod credentials;
2022-11-29 00:16:33 +00:00
mod errors;
2022-12-04 05:47:09 +00:00
mod clientinfo;
2022-11-29 00:16:33 +00:00
mod ipc;
mod state;
mod server;
2022-12-21 22:49:01 +00:00
mod tray;
2022-08-14 20:27:41 +00:00
2023-04-28 21:33:04 +00:00
use crate::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(("show", m)) => cli::show(m),
Some(("exec", m)) => cli::exec(m),
_ => unreachable!(),
};
if let Err(e) = res {
eprintln!("Error: {e}");
}
}