Parse the monitoring side setting from "--monitor" (#67).

This commit is contained in:
Andrew Wood
2026-03-14 14:28:30 +00:00
parent 111b687449
commit c2bbb8eef1
2 changed files with 55 additions and 1 deletions
+10
View File
@@ -36,6 +36,15 @@ typedef enum {
PV_ACTION_MONITOR /* run a process, watch its stdin/out */
} pvaction_t;
/*
* Sides of a monitored command to monitor with PV_ACTION_MONITOR.
*/
typedef enum {
PV_SIDE_IN, /* monitor only the input side */
PV_SIDE_OUT, /* monitor only the output side */
PV_SIDE_BOTH /* monitor both sides */
} pvside_t;
/*
* Structure describing run-time options.
*
@@ -71,6 +80,7 @@ struct opts_s {
unsigned int watchfd_count; /* number of watchfd items */
unsigned int watchfd_length; /* allocated array size */
pvaction_t action; /* the program action to perform */
pvside_t side; /* which side of the monitored command to monitor */
bool progress; /* progress bar flag */
bool timer; /* timer flag */
bool eta; /* ETA flag */