Skip to content

Commit f0f582c

Browse files
committed
remove pub
1 parent 16596ac commit f0f582c

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/main.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ use hayabusa::detections::utils::{
5656
check_setting_path, get_writable_color, output_and_data_stack_for_html, output_profile_name,
5757
};
5858
use hayabusa::filter::create_channel_filter;
59-
use hayabusa::options::auto_complete::{print_completer, select_shell};
59+
use hayabusa::options::auto_complete::auto_complete;
6060
use hayabusa::options::htmlreport::{self, HTML_REPORTER};
6161
use hayabusa::options::pivot::create_output;
6262
use hayabusa::options::pivot::PIVOT_KEYWORD;
@@ -157,8 +157,7 @@ impl App {
157157

158158
//ロゴと時間が表示さないように実行したい
159159
if let Action::AutoComplete(_) = &stored_static.config.action.as_ref().unwrap() {
160-
let shell = select_shell();
161-
print_completer(shell, app);
160+
auto_complete(app);
162161
return;
163162
}
164163

src/options/auto_complete.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
use clap_complete::{generate, Generator, Shell};
22
use dialoguer::Select;
33

4-
pub fn select_shell() -> Shell {
4+
pub fn auto_complete(app: &mut clap::Command) {
5+
let shell = select_shell();
6+
print_completer(shell, app);
7+
}
8+
9+
fn select_shell() -> Shell {
510
let items:Vec<Shell> = vec![Shell::Bash, Shell::Elvish, Shell::Fish, Shell::PowerShell, Shell::Zsh];
611

712
let selection = Select::new()
@@ -12,7 +17,7 @@ pub fn select_shell() -> Shell {
1217

1318
items[selection]
1419
}
15-
pub fn print_completer<G: Generator>(generator: G, app: &mut clap::Command) {
20+
fn print_completer<G: Generator>(generator: G, app: &mut clap::Command) {
1621
let name = app.get_name().to_owned();
1722

1823
generate(generator, app, name, &mut std::io::stdout());

0 commit comments

Comments
 (0)