Replace pv_state_set_format() with pv_set_format_options(), which takes a structure rather than a long list of arguments, to make it easier to pass around - and rely on pv_state_name_set() being called first rather than doing it within this function, so it is only doing one job (#67).

This commit is contained in:
Andrew Wood
2026-04-03 20:00:42 +01:00
parent 80358e84f3
commit d7327aaf95
5 changed files with 87 additions and 79 deletions
+1 -11
View File
@@ -209,17 +209,7 @@ struct pvstate_s {
pvdisplay_width_t width; /* screen width */
unsigned int height; /* screen height */
unsigned int extra_displays; /* bitmask of extra display destinations */
struct { /* old-style format options (used by -R) */
size_t lastwritten; /* --last-written (amount) */
bool progress; /* --progress */
bool timer; /* --timer */
bool eta; /* --eta */
bool fineta; /* --fineta */
bool rate; /* --rate */
bool average_rate; /* --average-rate */
bool bytes; /* --bytes */
bool bufpercent; /* --buffer-percent */
} format_option;
pvformatoptions_s format_option; /* old-style format options (used by -R) */
bool force; /* display even if not on terminal */
bool cursor; /* use cursor positioning */
bool numeric; /* numeric output only */