mirror of
https://github.com/ivre/masscanned.git
synced 2025-10-02 06:38:21 +00:00
Add quiet mode
This commit is contained in:
parent
4df3d17626
commit
cc2457db67
2 changed files with 12 additions and 2 deletions
|
@ -98,6 +98,7 @@ OPTIONS:
|
||||||
--ip-addr <iplist> Inline list of IP addresses to impersonate, comma-separated
|
--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
|
--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
|
-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 Increase message verbosity
|
||||||
-V, --version Print version information
|
-V, --version Print version information
|
||||||
```
|
```
|
||||||
|
|
|
@ -139,6 +139,13 @@ fn main() {
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.help("Increase message verbosity"),
|
.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();
|
.get_matches();
|
||||||
let verbose = args.occurrences_of("verbosity") as usize;
|
let verbose = args.occurrences_of("verbosity") as usize;
|
||||||
/* initialise logger */
|
/* initialise logger */
|
||||||
|
@ -210,8 +217,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") {
|
||||||
masscanned.log.add(Box::new(ConsoleLogger::new()));
|
masscanned.log.add(Box::new(ConsoleLogger::new()));
|
||||||
masscanned.log.init();
|
masscanned.log.init();
|
||||||
|
}
|
||||||
let (mut tx, mut rx) = get_channel(masscanned.iface.unwrap());
|
let (mut tx, mut rx) = get_channel(masscanned.iface.unwrap());
|
||||||
loop {
|
loop {
|
||||||
/* check if network interface is still up */
|
/* check if network interface is still up */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue