Skip to content

Commit

Permalink
Merge pull request #1316 from Yamato-Security/1309-h-help-option-is-b…
Browse files Browse the repository at this point in the history
…eing-displayed-multiple-times

Fixed `-h, --help` option is being displayed multiple times
  • Loading branch information
hitenkoku authored Mar 17, 2024
2 parents bfa3750 + c7f96d5 commit ae75672
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-Japanese.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

- `search` コマンドのJSON出力で`AllFieldInfo`フィールドの情報が出力されなくなっていたのを修正した。 (#1251) (@hitenkoku)
- ウィザードのオプション選択の時間が処理時間の中に含まれていたため除外した。 (#1291) (@hitenkoku)
- `-h, --help`オプションが重複して複数回表示されていた問題を修正した。 (#1309) (@hitenkoku)

## 2.13.0 [2024/02/11] "Year Of The Dragon Release"

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

- JSON output of the `search` command was missing the `AllFieldInfo` field. (#1251) (@hitenkoku)
- The time the user took to choose options in the scan wizard was included in elapsed time so we now exclude that. (#1291) (@hitenkoku)
- Fixed `-h, --help` option is being displayed multiple times. (#1309) (@hitenkoku)

## 2.13.0 [2024/02/11] "Year Of The Dragon Release"

Expand Down
45 changes: 28 additions & 17 deletions src/detections/configs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,8 @@ pub enum Action {
author = "Yamato Security (https://github.com/Yamato-Security/hayabusa - @SecurityYamato)",
help_template = "\nHayabusa v2.14.0 - Dev Build\n{author-with-newline}\n{usage-heading}\n hayabusa.exe csv-timeline <INPUT> [OPTIONS]\n\n{all-args}",
term_width = 400,
display_order = 290
display_order = 290,
disable_help_flag = true
)]
/// Save the timeline in CSV format.
CsvTimeline(CsvOutputOption),
Expand All @@ -785,7 +786,8 @@ pub enum Action {
author = "Yamato Security (https://github.com/Yamato-Security/hayabusa - @SecurityYamato)",
help_template = "\nHayabusa v2.14.0 - Dev Build\n{author-with-newline}\n{usage-heading}\n hayabusa.exe json-timeline <INPUT> [OPTIONS]\n\n{all-args}",
term_width = 400,
display_order = 360
display_order = 360,
disable_help_flag = true
)]
/// Save the timeline in JSON/JSONL format.
JsonTimeline(JSONOutputOption),
Expand All @@ -794,7 +796,8 @@ pub enum Action {
author = "Yamato Security (https://github.com/Yamato-Security/hayabusa - @SecurityYamato)",
help_template = "\nHayabusa v2.14.0 - Dev Build\n{author-with-newline}\n{usage-heading}\n hayabusa.exe logon-summary <INPUT> [OPTIONS]\n\n{all-args}",
term_width = 400,
display_order = 383
display_order = 383,
disable_help_flag = true
)]
/// Print a summary of successful and failed logons
LogonSummary(LogonSummaryOption),
Expand All @@ -803,7 +806,8 @@ pub enum Action {
author = "Yamato Security (https://github.com/Yamato-Security/hayabusa - @SecurityYamato)",
help_template = "\nHayabusa v2.14.0 - Dev Build\n{author-with-newline}\n{usage-heading}\n hayabusa.exe eid-metrics <INPUT> [OPTIONS]\n\n{all-args}",
term_width = 400,
display_order = 310
display_order = 310,
disable_help_flag = true
)]
/// Print event ID metrics
EidMetrics(EidMetricsOption),
Expand All @@ -812,7 +816,8 @@ pub enum Action {
author = "Yamato Security (https://github.com/Yamato-Security/hayabusa - @SecurityYamato)",
help_template = "\nHayabusa v2.14.0 - Dev Build\n{author-with-newline}\n{usage-heading}\n hayabusa.exe pivot-keywords-list <INPUT> [OPTIONS]\n\n{all-args}",
term_width = 400,
display_order = 420
display_order = 420,
disable_help_flag = true
)]
/// Create a list of pivot keywords
PivotKeywordsList(PivotKeywordOption),
Expand All @@ -821,7 +826,8 @@ pub enum Action {
author = "Yamato Security (https://github.com/Yamato-Security/hayabusa - @SecurityYamato)",
help_template = "\nHayabusa v2.14.0 - Dev Build\n{author-with-newline}\n{usage-heading}\n hayabusa.exe search <INPUT> <--keywords \"<KEYWORDS>\" OR --regex \"<REGEX>\"> [OPTIONS]\n\n{all-args}",
term_width = 400,
display_order = 450
display_order = 450,
disable_help_flag = true
)]
/// Search all events by keyword(s) or regular expression
Search(SearchOption),
Expand All @@ -830,7 +836,8 @@ pub enum Action {
author = "Yamato Security (https://github.com/Yamato-Security/hayabusa - @SecurityYamato)",
help_template = "\nHayabusa v2.14.0 - Dev Build\n{author-with-newline}\n{usage-heading}\n {usage}\n\n{all-args}",
term_width = 400,
display_order = 470
display_order = 470,
disable_help_flag = true
)]
/// Update to the latest rules in the hayabusa-rules github repository
UpdateRules(UpdateOption),
Expand All @@ -839,7 +846,8 @@ pub enum Action {
author = "Yamato Security (https://github.com/Yamato-Security/hayabusa - @SecurityYamato)",
help_template = "\nHayabusa v2.14.0 - Dev Build\n{author-with-newline}\n{usage-heading}\n {usage}\n\n{all-args}",
term_width = 400,
display_order = 380
display_order = 380,
disable_help_flag = true
)]
/// Tune alert levels (default: ./rules/config/level_tuning.txt)
LevelTuning(LevelTuningOption),
Expand All @@ -848,7 +856,8 @@ pub enum Action {
author = "Yamato Security (https://github.com/Yamato-Security/hayabusa - @SecurityYamato)",
help_template = "\nHayabusa v2.14.0 - Dev Build\n{author-with-newline}\n{usage-heading}\n {usage}\n\n{all-args}",
term_width = 400,
display_order = 451
display_order = 451,
disable_help_flag = true
)]
/// Set default output profile
SetDefaultProfile(DefaultProfileOption),
Expand All @@ -865,7 +874,8 @@ pub enum Action {
author = "Yamato Security (https://github.com/Yamato-Security/hayabusa - @SecurityYamato)",
help_template = "\nHayabusa v2.14.0 - Dev Build\n{author-with-newline}\n{usage-heading}\n hayabusa.exe computer-metrics <INPUT> [OPTIONS]\n\n{all-args}",
term_width = 400,
display_order = 290
display_order = 290,
disable_help_flag = true
)]
/// Print computer name metrics
ComputerMetrics(ComputerMetricsOption),
Expand Down Expand Up @@ -917,7 +927,7 @@ impl Action {
#[derive(Args, Clone, Debug)]
pub struct DetectCommonOption {
/// Scan JSON formatted logs instead of .evtx (.json or .jsonl)
#[arg(help_heading = Some("General Options"), short = 'J', long = "JSON-input", conflicts_with = "live_analysis", display_order = 390)]
#[arg(help_heading = Some("General Options"), short = 'J', long = "JSON-input", conflicts_with = "live_analysis", display_order = 360)]
pub json_input: bool,

/// Specify additional evtx file extensions (ex: evtx_data)
Expand Down Expand Up @@ -946,7 +956,7 @@ pub struct DetectCommonOption {
default_value = "./rules/config",
hide_default_value = true,
value_name = "DIR",
display_order = 441
display_order = 442
)]
pub config: PathBuf,

Expand Down Expand Up @@ -1071,7 +1081,7 @@ pub struct SearchOption {
default_value = "./rules/config",
hide_default_value = true,
value_name = "DIR",
display_order = 441
display_order = 442
)]
pub config: PathBuf,

Expand Down Expand Up @@ -1138,7 +1148,7 @@ pub struct UpdateOption {
hide_default_value = true,
value_name = "DIR/FILE",
requires = "no_wizard",
display_order = 440
display_order = 441
)]
pub rules: PathBuf,
}
Expand Down Expand Up @@ -1508,7 +1518,7 @@ pub struct OutputOption {
hide_default_value = true,
value_name = "DIR/FILE",
requires = "no_wizard",
display_order = 440
display_order = 441
)]
pub rules: PathBuf,

Expand Down Expand Up @@ -1685,7 +1695,7 @@ pub struct ComputerMetricsOption {
default_value = "./rules/config",
hide_default_value = true,
value_name = "DIR",
display_order = 441
display_order = 442
)]
pub config: PathBuf,

Expand All @@ -1702,7 +1712,8 @@ pub struct ComputerMetricsOption {
#[clap(
author = "Yamato Security (https://github.com/Yamato-Security/hayabusa - @SecurityYamato)",
help_template = "\nHayabusa v2.14.0 - Dev Build\n{author-with-newline}\n{usage-heading}\n hayabusa.exe <COMMAND> [OPTIONS]\n hayabusa.exe help <COMMAND>\n\n{all-args}{options}",
term_width = 400
term_width = 400,
disable_help_flag = true
)]
pub struct Config {
#[command(subcommand)]
Expand Down

0 comments on commit ae75672

Please sign in to comment.