aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorache <ache@ache.one>2026-08-16 21:57:55 +0200
committerache <ache@ache.one>2026-08-16 21:57:55 +0200
commitf31f02f6bee6bf5d98d2d9468762cf6ea9d4360a (patch)
tree5effa2c2351f7f4901b52f7026dccab2f9c3fcad /src/main.rs
parentRemove unusde import and cast (diff)
Add the remainder line option
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs
index f35a052..00f6b49 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -13,7 +13,7 @@ mod stats;
use args::Args;
use ip::parse_ip;
use pinger::{PingResult, spawn_ping};
-use print::{print_legende_line, print_ping_line, print_stats};
+use print::{print_legende_line, print_ping_line, print_stats, print_remainder_line};
use state::State;
use stats::compute_stats;
@@ -131,10 +131,13 @@ fn main_loop(
async fn main() {
let args = Args::parse();
- let target: IpAddr = if let Some(target_str) = args.target.clone() {
+ let target_str: String;
+ let target: IpAddr = if let Some(target_arg) = args.target.clone() {
+ target_str = target_arg;
parse_target(&target_str)
} else if let Some(default_target_str) = args.default_target.clone() {
- parse_target(&default_target_str)
+ target_str = default_target_str;
+ parse_target(&target_str)
} else {
eprintln!("Error: target address is required");
std::process::exit(1);
@@ -150,8 +153,7 @@ async fn main() {
}
if args.remainder {
- // TODO: Not yet implemented
- // print_remainder_line
+ print_remainder_line(&target_str, &target);
}
// Save the current cursor position