Add a "--gauge" option which alters the progress bar to show the current rate as a percentage of the max rate seen, if the size is unknown (#46).

This commit is contained in:
Andrew Wood
2024-10-04 22:15:14 +01:00
parent fbe726e4c4
commit c548d1f2d8
15 changed files with 361 additions and 255 deletions
+1
View File
@@ -2,6 +2,7 @@
* feature: new "`--stats`" option to show transfer stats at the end, like "`ping`" ([#49](https://codeberg.org/a-j-wood/pv/issues/49))
* feature: "`--rate`" can now be used with "`--numeric`" ([#17](https://codeberg.org/a-j-wood/pv/issues/17))
* feature: "`--gauge`" with "`--progress`" to show rate gauge when size is unknown ([#46](https://codeberg.org/a-j-wood/pv/issues/46))
* i18n: complete set of German translations supplied by Hartmut Goebel ([#98](https://codeberg.org/a-j-wood/pv/pulls/98))
* fix: resume stopped pipelines when running in the background (part of [#56](https://codeberg.org/a-j-wood/pv/issues/56))
* fix: prefix completion time ("`--fineta`") with *FIN* rather than *ETA* ([#43](https://codeberg.org/a-j-wood/pv/issues/43))
+17 -1
View File
@@ -118,7 +118,10 @@ unreadable, and no size was explicitly given (with the
.B \-s
modifier), the progress bar cannot indicate how close to completion the
transfer is, so it will just move left and right to indicate that data is
moving.
moving - or, with
.BR \-\-gauge ,
the bar will indicate the current rate as a percentage of the maximum rate
seen so far.
.TP
.B \-t, \-\-timer
Turn the timer on. This will display the total elapsed time that
@@ -289,6 +292,11 @@ has no effect if used with
to watch all file descriptors of a process, but will work with
.BR "-d PID:FD" .
.TP
.B \-g, \-\-gauge
If the progress bar is shown but the size is not known, then instead of
moving the bar left and right to show progress, show the current transfer
rate as a percentage of the maximum rate seen so far.
.TP
.B \-l, \-\-line\-mode
Instead of counting bytes, count lines (newline characters). The progress
bar will only move when a new line is found, and the value passed to the
@@ -635,6 +643,14 @@ average rate, and current rate.
Show a progress bar, elapsed time, estimated completion time, line counter,
and average rate, counting lines instead of bytes.
.TP
.B pv -btrpg
Show the amount transferred, elapsed time, current rate, and a gauge showing
the current rate as a percentage of the maximum rate seen - useful in a
pipeline where the total size is unknown. (If the size
.I is
known, these options will show the percentage completion instead of the rate
gauge).
.TP
.B pv -t
Show only the elapsed time - useful as a simple timer, e.g.
.BR "sleep 10m | pv -t" .
+16 -1
View File
@@ -80,7 +80,8 @@ display types that are explicitly switched on will be shown.
unreadable, and no size was explicitly given (with the **-s**
modifier), the progress bar cannot indicate how close to completion
the transfer is, so it will just move left and right to indicate
that data is moving.
that data is moving - or, with **\--gauge**, the bar will indicate
the current rate as a percentage of the maximum rate seen so far.
**-t, \--timer**
@@ -207,6 +208,12 @@ display types that are explicitly switched on will be shown.
watch all file descriptors of a process, but will work with **-d
PID:FD**.
**-g, \--gauge**
: If the progress bar is shown but the size is not known, then instead
of moving the bar left and right to show progress, show the current
transfer rate as a percentage of the maximum rate seen so far.
**-l, \--line-mode**
: Instead of counting bytes, count lines (newline characters). The
@@ -474,6 +481,14 @@ Some suggested common switch combinations:
: Show a progress bar, elapsed time, estimated completion time, line
counter, and average rate, counting lines instead of bytes.
**pv -btrpg**
: Show the amount transferred, elapsed time, current rate, and a gauge
showing the current rate as a percentage of the maximum rate seen -
useful in a pipeline where the total size is unknown. (If the size
*is* known, these options will show the percentage completion
instead of the rate gauge).
**pv -t**
: Show only the elapsed time - useful as a simple timer, e.g. **sleep