From 86d1f20a0e0d138c35fdfea06a42bc5750f36114 Mon Sep 17 00:00:00 2001 From: DustInDark <2350416+hitenkoku@users.noreply.github.com> Date: Sun, 4 Feb 2024 21:40:26 +0900 Subject: [PATCH] fix(configs): fixed no help error in no required option command #1255 --- src/detections/configs.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/detections/configs.rs b/src/detections/configs.rs index de1b7c977..919271f11 100644 --- a/src/detections/configs.rs +++ b/src/detections/configs.rs @@ -122,7 +122,7 @@ impl StoredStatic { None => CommonOptions { no_color: false, quiet: false, - help: false, + help: None, }, }; let binding = Path::new("./rules/config").to_path_buf(); @@ -1521,8 +1521,8 @@ pub struct CommonOptions { pub quiet: bool, /// Show the help menu - #[clap(help_heading = Some("General Options"), short = 'h', long = "help", global = true, action = ArgAction::Help, display_order = 80)] - pub help: bool, + #[clap(help_heading = Some("General Options"), short = 'h', long = "help", action = ArgAction::Help, display_order = 80, required = false)] + pub help: Option, } #[derive(Args, Clone, Debug)] @@ -1657,8 +1657,7 @@ pub struct ComputerMetricsOption { #[clap( author = "Yamato Security (https://github.com/Yamato-Security/hayabusa - @SecurityYamato)", help_template = "\nHayabusa v2.13.0 - Dev Build\n{author-with-newline}\n{usage-heading}\n hayabusa.exe [OPTIONS]\n hayabusa.exe help \n\n{all-args}{options}", - term_width = 400, - disable_help_flag = true + term_width = 400 )] pub struct Config { #[command(subcommand)]