From 93a8b764592879d20c8815c7925e0cad307861e5 Mon Sep 17 00:00:00 2001 From: Pihkaal Date: Sat, 20 Jan 2024 20:37:01 +0100 Subject: [PATCH] fix: make debug mode optional --- src/main.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index abe5ca3..3925640 100644 --- a/src/main.rs +++ b/src/main.rs @@ -38,7 +38,7 @@ struct Cli { yes: bool, #[command(subcommand)] - command: Commands, + command: Option, } #[derive(Subcommand, Debug)] @@ -50,9 +50,10 @@ fn main() -> io::Result<()> { let cli = Cli::parse(); match &cli.command { - Commands::Debug {} => { + Some(Commands::Debug {}) => { debug::enable_debug_mode(); } + _ => {} } // Load config @@ -99,10 +100,11 @@ fn main() -> io::Result<()> { let mut stdout = io::stdout(); match &cli.command { - Commands::Debug {} => { + Some(Commands::Debug {}) => { print_debug_infos(&mut config)?; return Ok(()); } + _ => {} } // Switch to alternate screen, hide the cursor and enable raw mode