37 lines
653 B
Rust
37 lines
653 B
Rust
#![cfg_attr(
|
|
all(not(debug_assertions), target_os = "windows"),
|
|
windows_subsystem = "windows"
|
|
)]
|
|
|
|
|
|
mod app;
|
|
mod cli;
|
|
mod config;
|
|
mod credentials;
|
|
mod errors;
|
|
mod clientinfo;
|
|
mod ipc;
|
|
mod state;
|
|
mod server;
|
|
mod tray;
|
|
|
|
|
|
use crate::errors::ErrorPopup;
|
|
|
|
|
|
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}");
|
|
}
|
|
}
|