diff options
| author | ache <ache@ache.one> | 2026-08-16 22:01:58 +0200 |
|---|---|---|
| committer | ache <ache@ache.one> | 2026-08-16 22:01:58 +0200 |
| commit | 0620be9bab315f5f30cb5120ae56ff3d50d3775c (patch) | |
| tree | aa41e5e5392bf721d4c5f9be79d7ac928c8ae45e | |
| parent | Don't count NotYetReceived packet as lost (diff) | |
Rename remainder line to status line
| -rw-r--r-- | src/args.rs | 6 | ||||
| -rw-r--r-- | src/main.rs | 6 | ||||
| -rw-r--r-- | src/print.rs | 4 |
3 files changed, 7 insertions, 9 deletions
diff --git a/src/args.rs b/src/args.rs index 6fdca59..fe74f5e 100644 --- a/src/args.rs +++ b/src/args.rs @@ -33,9 +33,9 @@ pub struct Args { #[arg(short = 'l', long = "legende", action = ArgAction::SetTrue)] pub legende: bool, - /// Print the remainder line - #[arg(short = 'r', long = "remainder", action = ArgAction::SetTrue)] - pub remainder: bool, + /// Print the status line, the given target and the IP the ping is send to. + #[arg(long = "status", action = ArgAction::SetTrue)] + pub status: bool, /// Default target, if none is specified #[arg(long = "default-target", value_name = "default_target")] diff --git a/src/main.rs b/src/main.rs index 00f6b49..2ca6fc7 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, print_remainder_line}; +use print::{print_legende_line, print_ping_line, print_stats, print_status_line}; use state::State; use stats::compute_stats; @@ -152,8 +152,8 @@ async fn main() { print_legende_line(); } - if args.remainder { - print_remainder_line(&target_str, &target); + if args.status { + print_status_line(&target_str, &target); } // Save the current cursor position diff --git a/src/print.rs b/src/print.rs index f359c92..e68e8ea 100644 --- a/src/print.rs +++ b/src/print.rs @@ -1,5 +1,3 @@ -// src/print.rs - use crate::state::State; use crate::stats::Stats; use std::net::IpAddr; @@ -182,7 +180,7 @@ const LEN_BY_NB_ELEMENT: [u32; 26] = [ ]; -pub fn print_remainder_line(target_str: &String, ip: &IpAddr) { +pub fn print_status_line(target_str: &String, ip: &IpAddr) { println!("PING {} ({})", target_str, ip); } |