From c56755a024c264e9c3028a3cb9696c1afe5dbca9 Mon Sep 17 00:00:00 2001 From: ache Date: Sun, 16 Aug 2026 23:18:10 +0200 Subject: Add a real README --- README.md | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 80 insertions(+), 8 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 76798b1..d16359f 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ # rusty-ping -A replacement for [prettyping](https://github.com/denilsonsa/prettyping). - -A basic ping utility that tries to be visual, with no external dependencies. +A replacement for [prettyping](https://github.com/denilsonsa/prettyping). +A very simple ping utility that tries to be as visual as possible, does NOT use the ping command. ## Install @@ -24,11 +23,84 @@ or after installation: $ rusty-ping ``` +## Shell integration + +Rusty-ping doesn't use a config file to keep things as simple as possible. +The goal is to type 'pp' to quickly do a ping, I will not call rusty-ping pp as it may conflict with other CLI. +So the configuration step and alias to 'pp' is done with some shell integration. + +I use fish, so if something breaks with `bash` / `zsh`, just send me a e-mail. + +### Fish + +I prefere to use fish abbreviation. + +`$HOME/.config/fish/function/pp.fish` + +```fish +abbr --add pp rusty-ping --stats --status --default-target 2606:4700:4700::1111 +``` + +But a function works too. + +```fish +function pp + rusty-ping --stats --status --default-target 2606:4700:4700::1111 +end +``` + +### Bash / zsh + +You can just use a function : + +```bash +function pp { + rusty-ping --stats --legende --status --default-target 2606:4700:4700::1111 +} +``` + +## "User Interface" + +Here is the full UI and the explainations : + +```shell +rusty-ping --stats --status --default-target git.ache.one --legende +0 ▁ 30 ▄ 50 ▆ 70 █ 90 ▂ 120 ▅ 150 █ 170 ▂ 190 ▄ 210 ▆ 240 ? <-- The legende (--legende) +PING git.ache.one (145.239.86.0) <-- The status line (--status) +▄▄▄▄▄▄▄▄? <-- The ping line +0/9 (0.0%) | ⌊34⌋ ⌈35⌉ [35] [Δ0]ms <-- Statistics on every packet (--stats) +0/9 (0.0%) | ⌊34⌋ ⌈35⌉ [35] [Δ0]ms <-- Statistics on the lasts 30 packets (--stats) +``` + +The legende indicate which characters correspond to which RTT in the ping line. +On the ping line, every characters correspond to a ICMP packet send. + +? => Packet not yet received +! => Packet lost + +### The statistics + +RTT is expressed in miliseconds. + +```plain + ┏━> Number of packets lost / Total send (Percentage of packets lost) + │ ┏━> Just a separator +0/9 (0.0%) | ⌊36⌋ ⌈56⌉ [40] [Δ4]ms + │ │ │ ┕━> The mean absolute difference + │ │ │ to the average RTT + │ │ ┕━> The average RTT + │ ┕━> The maximal RTT + ┕━> The minimal RTT +``` + ## Technical Notes -- `clap` to parse args -- `tokio` for `mpsc` -- `icmp` crates for the ping -- Rust 2024 edition +It does NOT use the `ping` command. +It isn't tied to bash or any shell. + +### Rust dependancies: -_Still WIP_ +- `clap` to parse args +- `ping` crate to actually do the ping +- `term_size` to pretty print the legende +- `tokio` for `mpsc`, the default mpsc queue seems to be deprecated -- cgit v1.3-2-g11bf