28 lines
		
	
	
		
			561 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			561 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
#![cfg_attr(
 | 
						|
    all(not(debug_assertions), target_os = "windows"),
 | 
						|
    windows_subsystem = "windows"
 | 
						|
)]
 | 
						|
 | 
						|
use creddy::{
 | 
						|
    app,
 | 
						|
    cli,
 | 
						|
    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}");
 | 
						|
    }
 | 
						|
}
 |