aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/args.rs6
-rw-r--r--src/main.rs6
-rw-r--r--src/print.rs4
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);
}