Skip to content

Commit

Permalink
add -o option to AutoComplete
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuminn committed Jul 23, 2024
1 parent f82c784 commit 1200499
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/detections/configs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ impl StoredStatic {
Some(Action::LogonSummary(opt)) => opt.output.as_ref(),
Some(Action::Search(opt)) => opt.output.as_ref(),
Some(Action::ComputerMetrics(opt)) => opt.output.as_ref(),
Some(Action::AutoComplete(opt)) => opt.output.as_ref(),
_ => None,
};
let general_ch_abbr = create_output_filter_config(
Expand Down Expand Up @@ -949,6 +950,10 @@ impl Action {
pub struct AutoCompleteOptions {
#[clap(flatten)]
pub common_options: CommonOptions,

/// Save the auto complete in shell format (ex: auto-complete.sh)
#[arg(help_heading = Some("Output"), short = 'o', long, value_name = "FILE", display_order = 410)]
pub output: Option<PathBuf>,
}

#[derive(Args, Clone, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ impl App {
return;
}

//ロゴと時間が表示さないように実行したいので、この位置
//ロゴと時間が表示さないように実行したい
if let Action::AutoComplete(_) = &stored_static.config.action.as_ref().unwrap() {
auto_complete(app, stored_static.output_path.as_ref());
return;
Expand Down

0 comments on commit 1200499

Please sign in to comment.