mirror of
https://github.com/ivre/masscanned.git
synced 2025-10-02 14:48:22 +00:00
Fix other bug in clap
This commit is contained in:
parent
04c9621c7e
commit
ae175e7b77
1 changed files with 7 additions and 3 deletions
|
@ -143,8 +143,9 @@ fn main() {
|
||||||
Arg::new("quiet")
|
Arg::new("quiet")
|
||||||
.long("quiet")
|
.long("quiet")
|
||||||
.short('q')
|
.short('q')
|
||||||
.help("Quiet mode: do not output anything on stdout")
|
.action(ArgAction::SetTrue)
|
||||||
.num_args(0),
|
.required(false)
|
||||||
|
.help("Quiet mode: do not output anything on stdout"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new("format")
|
Arg::new("format")
|
||||||
|
@ -225,7 +226,10 @@ fn main() {
|
||||||
};
|
};
|
||||||
info!("interface......{}", masscanned.iface.unwrap().name);
|
info!("interface......{}", masscanned.iface.unwrap().name);
|
||||||
info!("mac address....{}", masscanned.mac);
|
info!("mac address....{}", masscanned.mac);
|
||||||
if !args.contains_id("quiet") {
|
if !args
|
||||||
|
.get_one::<bool>("quiet")
|
||||||
|
.expect("unexpected error parsing argument")
|
||||||
|
{
|
||||||
if let Some(format) = args.get_one::<String>("format") {
|
if let Some(format) = args.get_one::<String>("format") {
|
||||||
let chosen_logger: Box<dyn Logger> = match format.as_str() {
|
let chosen_logger: Box<dyn Logger> = match format.as_str() {
|
||||||
"console" => Box::new(ConsoleLogger::new()),
|
"console" => Box::new(ConsoleLogger::new()),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue