From d34e597360b30d5add26db38729782aa577df9fc Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Sun, 11 Dec 2022 21:55:27 +0900 Subject: [PATCH] Update help text and README.md --- README.md | 21 +++++++++++++-------- src/args.rs | 3 +++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 104fde9..023dd1f 100644 --- a/README.md +++ b/README.md @@ -17,14 +17,15 @@ tiling Wayland compositor](https://swaywm.org). ## Help Text Usage: - -h | --help Prints help - --netdev= Check network traffic on specified device - --netdev_width= Sets the min-width of the netdev output (default 10) - --netgraph_max_bytes= Enable "graph" output when polling network traffic - --interval-sec= Output at intervals of (default 5) - --acpi-builtin Use "acpi -b" built-in fetching (battery info, with color) - --regex-cmd=[SPLIT][SPLIT] Use an output of a command as a metric - --time-format= Set the format string for the date + -h | --help Prints help + --netdev= Check network traffic on specified device + --netdev_width= Sets the min-width of the netdev output (default 10) + --netgraph_max_bytes= Enable "graph" output when polling network traffic + (Set to "dynamic" instead of a byte count for dynamic sizing) + --interval-sec= Output at intervals of (default 5) + --acpi-builtin Use "acpi -b" built-in fetching (battery info, with color) + --regex-cmd=[SPLIT][SPLIT] Use an output of a command as a metric + --time-format= Set the format string for the date ## Usage @@ -107,6 +108,10 @@ characters](https://en.wikipedia.org/wiki/Block_Elements)). Thus, this outputs a history graph of network traffic. A sane value for `` can be 1048576, which is 1 MiB. +Specify "dynamic" instead of a bytecount (such as +`--netgraph_max_bytes=dynamic`) to have the graph dynamically resize based on +the maximum amount of bytes transferred in an interval. + ## Dependencies Uses [`serde_json`](https://crates.io/crates/serde_json), diff --git a/src/args.rs b/src/args.rs index 2c548e2..babfc51 100644 --- a/src/args.rs +++ b/src/args.rs @@ -64,6 +64,9 @@ pub fn print_usage() { stderr_handle .write_all(b" --netgraph_max_bytes=\t\t\t\tEnable \"graph\" output when polling network traffic\n") .ok(); + stderr_handle + .write_all(b" \t\t\t\t (Set to \"dynamic\" instead of a byte count for dynamic sizing)\n") + .ok(); stderr_handle .write_all( b" --interval-sec=\t\t\t\tOutput at intervals of (default 5)\n",