Update args.

Signed-off-by: Edu4rdSHL <edu4rdshl@protonmail.com>
This commit is contained in:
Edu4rdSHL 2021-05-10 20:39:29 -05:00
parent b8a47031d9
commit 1b79bcd334
No known key found for this signature in database
GPG key ID: 3A574A4009F553E5

View file

@ -29,7 +29,7 @@ pub fn get_args() -> Args {
} }
}, },
file_name: if matches.is_present("output") { file_name: if matches.is_present("output") {
value_t!(matches, "logs-dir", String).unwrap_or_else(|_| "logs".to_string()) value_t!(matches, "logs-dir", String).unwrap_or_else(|_| "unimap_logs".to_string())
+ "/" + "/"
+ "unimap" + "unimap"
+ &Utc::now().format("-log-%Y-%m-%d_%H-%M-%S").to_string() + &Utc::now().format("-log-%Y-%m-%d_%H-%M-%S").to_string()
@ -39,12 +39,9 @@ pub fn get_args() -> Args {
} else { } else {
String::new() String::new()
}, },
logs_dir: value_t!(matches, "logs-dir", String).unwrap_or_else(|_| "logs".to_string()), logs_dir: value_t!(matches, "logs-dir", String)
threads: if (matches.is_present("port-scan") .unwrap_or_else(|_| "unimap_logs".to_string()),
|| matches.is_present("initial-port") threads: if matches.is_present("ports") && !matches.is_present("threads") {
|| matches.is_present("last-port"))
&& !matches.is_present("threads")
{
30 30
} else { } else {
value_t!(matches, "threads", usize).unwrap_or_else(|_| 50) value_t!(matches, "threads", usize).unwrap_or_else(|_| 50)
@ -56,7 +53,7 @@ pub fn get_args() -> Args {
from_file_flag: matches.is_present("files"), from_file_flag: matches.is_present("files"),
quiet_flag: matches.is_present("quiet"), quiet_flag: matches.is_present("quiet"),
custom_resolvers: matches.is_present("custom-resolvers"), custom_resolvers: matches.is_present("custom-resolvers"),
custom_ports_range: matches.is_present("initial-port") || matches.is_present("last-port"), custom_ports_range: matches.is_present("ports"),
fast_scan: matches.is_present("fast-scan"), fast_scan: matches.is_present("fast-scan"),
no_keep_nmap_logs: matches.is_present("no-keep-nmap-logs"), no_keep_nmap_logs: matches.is_present("no-keep-nmap-logs"),
raw_output: matches.is_present("raw-output"), raw_output: matches.is_present("raw-output"),