Skip to content

Commit 3122d4e

Browse files
authored
Merge pull request #64 from ivre/enh-quiet
Add quiet mode
2 parents 4df3d17 + cc2457d commit 3122d4e

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

README.md

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

src/masscanned.rs

+11-2
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,13 @@ fn main() {
139139
.multiple_occurrences(true)
140140
.help("Increase message verbosity"),
141141
)
142+
.arg(
143+
Arg::new("quiet")
144+
.long("quiet")
145+
.short('q')
146+
.help("Quiet mode: do not output anything on stdout")
147+
.takes_value(false),
148+
)
142149
.get_matches();
143150
let verbose = args.occurrences_of("verbosity") as usize;
144151
/* initialise logger */
@@ -210,8 +217,10 @@ fn main() {
210217
};
211218
info!("interface......{}", masscanned.iface.unwrap().name);
212219
info!("mac address....{}", masscanned.mac);
213-
masscanned.log.add(Box::new(ConsoleLogger::new()));
214-
masscanned.log.init();
220+
if !args.contains_id("quiet") {
221+
masscanned.log.add(Box::new(ConsoleLogger::new()));
222+
masscanned.log.init();
223+
}
215224
let (mut tx, mut rx) = get_channel(masscanned.iface.unwrap());
216225
loop {
217226
/* check if network interface is still up */

0 commit comments

Comments
 (0)