Merge pull request #64 from ivre/enh-quiet

Add quiet mode
This commit is contained in:
_Frky 2022-09-20 15:12:00 +02:00 committed by GitHub
commit 3122d4e362
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View file

@ -98,6 +98,7 @@ OPTIONS:
--ip-addr <iplist> Inline list of IP addresses to impersonate, comma-separated
--ip-addr-file <ipfile> File with the list of IP addresses to impersonate
-m, --mac-addr <mac> MAC address to use in the response packets
-q, --quiet Quiet mode: does not output anything on stdout
-v Increase message verbosity
-V, --version Print version information
```

View file

@ -139,6 +139,13 @@ fn main() {
.multiple_occurrences(true)
.help("Increase message verbosity"),
)
.arg(
Arg::new("quiet")
.long("quiet")
.short('q')
.help("Quiet mode: do not output anything on stdout")
.takes_value(false),
)
.get_matches();
let verbose = args.occurrences_of("verbosity") as usize;
/* initialise logger */
@ -210,8 +217,10 @@ fn main() {
};
info!("interface......{}", masscanned.iface.unwrap().name);
info!("mac address....{}", masscanned.mac);
masscanned.log.add(Box::new(ConsoleLogger::new()));
masscanned.log.init();
if !args.contains_id("quiet") {
masscanned.log.add(Box::new(ConsoleLogger::new()));
masscanned.log.init();
}
let (mut tx, mut rx) = get_channel(masscanned.iface.unwrap());
loop {
/* check if network interface is still up */