mirror of
https://github.com/house-of-vanity/rexec.git
synced 2025-08-21 15:17:15 +00:00
Fix some error handling
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -1043,7 +1043,7 @@ checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rexec"
|
name = "rexec"
|
||||||
version = "1.0.3"
|
version = "1.0.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"brace-expand",
|
"brace-expand",
|
||||||
"clap 4.3.4",
|
"clap 4.3.4",
|
||||||
|
@@ -24,13 +24,13 @@ struct Args {
|
|||||||
#[arg(short, long, default_value_t = whoami::username())]
|
#[arg(short, long, default_value_t = whoami::username())]
|
||||||
username: String,
|
username: String,
|
||||||
|
|
||||||
#[arg(short, long, help = "Use known_hosts to build servers list")]
|
#[arg(short, long, help = "Use known_hosts to build servers list instead of string expansion.")]
|
||||||
known_hosts: bool,
|
known_hosts: bool,
|
||||||
|
|
||||||
#[arg(
|
#[arg(
|
||||||
short,
|
short,
|
||||||
long,
|
long,
|
||||||
help = "Expression to build server list. List and range expansion available. Example: 'web-[1:12]-io-{prod,dev}'"
|
help = "Expression to build server list. List and range expansion are supported. Example: 'web-[1:12]-io-{prod,dev}'"
|
||||||
)]
|
)]
|
||||||
expression: String,
|
expression: String,
|
||||||
|
|
||||||
@@ -171,6 +171,10 @@ fn main() {
|
|||||||
// Build MasshHostConfig hostnames list
|
// Build MasshHostConfig hostnames list
|
||||||
let mut massh_hosts: Vec<MasshHostConfig> = vec![];
|
let mut massh_hosts: Vec<MasshHostConfig> = vec![];
|
||||||
let mut hosts_and_ips: HashMap<IpAddr, String> = HashMap::new();
|
let mut hosts_and_ips: HashMap<IpAddr, String> = HashMap::new();
|
||||||
|
if args.parallel != 100 {
|
||||||
|
warn!("Parallelism: {} thread{}", &args.parallel, {if args.parallel != 1 {"s."} else {"."}});
|
||||||
|
}
|
||||||
|
|
||||||
info!("Matched hosts:");
|
info!("Matched hosts:");
|
||||||
for host in matched_hosts.iter() {
|
for host in matched_hosts.iter() {
|
||||||
let ip = match lookup_host(&host.name) {
|
let ip = match lookup_host(&host.name) {
|
||||||
|
Reference in New Issue
Block a user