#![cfg_attr( all(not(debug_assertions), target_os = "windows"), windows_subsystem = "windows" )] use creddy::{ app, errors::ShowError, }; use creddy_cli::{ Action, Cli, RunArgs, }; fn main() { let cli = Cli::parse(); let res = match cli.action { None => { let run_args = RunArgs { minimized: false }; app::run(run_args, cli.global_args).error_popup("Creddy encountered an error"); Ok(()) } Some(Action::Run(run_args)) => { app::run(run_args, cli.global_args).error_popup("Creddy encountered an error"); Ok(()) }, Some(Action::Get(args)) => creddy_cli::get(args, cli.global_args), Some(Action::Exec(args)) => creddy_cli::exec(args, cli.global_args), Some(Action::Shortcut(args)) => creddy_cli::invoke_shortcut(args, cli.global_args), Some(Action::Docker(cmd)) => creddy_cli::docker_credential_helper(cmd, cli.global_args), }; if let Err(e) = res { eprintln!("Error: {e}"); std::process::exit(1); } }