passed test verstion (arg_required_else_help is false)

This commit is contained in:
DastInDark
2022-08-11 19:48:36 +09:00
parent acab188fec
commit 436a61a436
2 changed files with 8 additions and 1 deletions

View File

@@ -58,7 +58,7 @@ impl Default for ConfigReader<'_> {
usage = "hayabusa.exe <INPUT> [OTHER-ACTIONS] [OPTIONS]",
author = "Yamato Security (https://github.com/Yamato-Security/hayabusa) @SecurityYamato)",
help_template = "\n{name}\n{author}\n\n{usage-heading}\n {usage}\n\n{all-args}\n",
arg_required_else_help(true),
// arg_required_else_help(true),
term_width = 400
)]
pub struct Config {

View File

@@ -89,6 +89,13 @@ impl App {
return;
}
let analysis_start_time: DateTime<Local> = Local::now();
// Show usage when no arguments.
if std::env::args().len() == 1 {
self.output_logo();
configs::CONFIG.write().unwrap().app.print_help().ok();
println!();
return;
}
if !configs::CONFIG.read().unwrap().args.quiet {
self.output_logo();
println!();