fix: make debug mode optional

This commit is contained in:
Pihkaal
2024-01-20 20:37:01 +01:00
parent 435699e8a1
commit 93a8b76459

View File

@@ -38,7 +38,7 @@ struct Cli {
yes: bool, yes: bool,
#[command(subcommand)] #[command(subcommand)]
command: Commands, command: Option<Commands>,
} }
#[derive(Subcommand, Debug)] #[derive(Subcommand, Debug)]
@@ -50,9 +50,10 @@ fn main() -> io::Result<()> {
let cli = Cli::parse(); let cli = Cli::parse();
match &cli.command { match &cli.command {
Commands::Debug {} => { Some(Commands::Debug {}) => {
debug::enable_debug_mode(); debug::enable_debug_mode();
} }
_ => {}
} }
// Load config // Load config
@@ -99,10 +100,11 @@ fn main() -> io::Result<()> {
let mut stdout = io::stdout(); let mut stdout = io::stdout();
match &cli.command { match &cli.command {
Commands::Debug {} => { Some(Commands::Debug {}) => {
print_debug_infos(&mut config)?; print_debug_infos(&mut config)?;
return Ok(()); return Ok(());
} }
_ => {}
} }
// Switch to alternate screen, hide the cursor and enable raw mode // Switch to alternate screen, hide the cursor and enable raw mode