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
@@ -66,6 +66,7 @@ struct opts_s {
bool cursor; /* whether to use cursor positioning */
bool numeric; /* numeric output only */
bool wait; /* wait for transfer before display */
bool rate_gauge; /* if size unknown, show rate vs max rate */
bool linemode; /* count lines instead of bytes */
bool null_terminated_lines; /* lines are null-terminated */
bool no_display; /* do nothing other than pipe data */
+1
View File
@@ -123,6 +123,7 @@ struct pvstate_s {
bool cursor; /* use cursor positioning */
bool numeric; /* numeric output only */
bool wait; /* wait for data before display */
bool rate_gauge; /* if size unknown, show rate vs max rate */
bool linemode; /* count lines instead of bytes */
bool bits; /* report bits instead of bytes */
bool decimal_units; /* use decimal prefixes */
+1
View File
@@ -183,6 +183,7 @@ extern void pv_state_show_stats_set(pvstate_t, bool);
extern void pv_state_numeric_set(pvstate_t, bool);
extern void pv_state_wait_set(pvstate_t, bool);
extern void pv_state_delay_start_set(pvstate_t, double);
extern void pv_state_rate_gauge_set(pvstate_t, bool);
extern void pv_state_linemode_set(pvstate_t, bool);
extern void pv_state_bits_set(pvstate_t, bool);
extern void pv_state_decimal_units_set(pvstate_t, bool);