31 lines
744 B
Rust
31 lines
744 B
Rust
#![cfg_attr(
|
|
all(not(debug_assertions), target_os = "windows"),
|
|
windows_subsystem = "windows"
|
|
)]
|
|
|
|
use creddy::{
|
|
app,
|
|
cli,
|
|
errors::ShowError,
|
|
};
|
|
|
|
|
|
fn main() {
|
|
let global_matches = cli::parser().get_matches();
|
|
let res = match global_matches.subcommand() {
|
|
None | Some(("run", _)) => {
|
|
app::run().error_popup("Creddy encountered an error");
|
|
Ok(())
|
|
},
|
|
Some(("get", m)) => cli::get(m, &global_matches),
|
|
Some(("exec", m)) => cli::exec(m, &global_matches),
|
|
Some(("shortcut", m)) => cli::invoke_shortcut(m, &global_matches),
|
|
_ => unreachable!(),
|
|
};
|
|
|
|
if let Err(e) = res {
|
|
eprintln!("Error: {e}");
|
|
std::process::exit(1);
|
|
}
|
|
}
|