From c688987087ff386991b2881da31f02d17c1f7d34 Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Thu, 25 Sep 2025 06:21:55 +0100 Subject: [PATCH] Adjust the --watchfd documentation to say that multiple PID/PID:FD arguments are allowed (#12). --- docs/pv.1 | 22 ++++++++++++++-------- docs/pv.1.md | 21 +++++++++++++-------- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/docs/pv.1 b/docs/pv.1 index cf9eced..15f1065 100644 --- a/docs/pv.1 +++ b/docs/pv.1 @@ -1,4 +1,4 @@ -.TH PV 1 2025-07-26 pv-1.9.34 "User Commands" +.TH PV 1 2025-09-25 pv-1.9.34 "User Commands" .\" .SH NAME pv \- monitor the progress of data through a pipe @@ -7,7 +7,7 @@ pv \- monitor the progress of data through a pipe .B pv [\fIOPTION\fR]... [\fIFILE\fR]... .PP -\fBpv\fR \fB\-d\fR|\fB\-\-watchfd\fR \fIPID\fR[:\fIFD\fR] [\fIOPTION\fR]... +\fBpv\fR [\fIOPTION\fR]... \fB\-d\fR|\fB\-\-watchfd\fR \fIPID\fR[:\fIFD\fR]... .PP \fBpv\fR \fB\-R\fR|\fB\-\-remote\fR \fIPID\fR [\fIOPTION\fR]... .\" @@ -352,13 +352,19 @@ doesn't affect the progress display. .BI \-d\ PID\fR[\fB:\fR\fIFD\fR],\ \fB\-\-watchfd\ PID\fR[\fB:\fR\fIFD\fR] Instead of transferring data, watch file descriptor \fIFD\fR of process \fIPID\fR, and show its progress. -The \fBpv\fR process will exit when \fIFD\fR either changes to a different -file, changes read/write mode, or is closed; other data transfer modifiers - -and remote control - may not be used with this option. +Other data transfer modifiers - and remote control - may not be used with +this option. .IP -If only a \fIPID\fR is specified, then that process will be watched, and all -regular files and block devices it opens will be shown with a progress bar. -The \fBpv\fR process will exit when process \fIPID\fR exits. +If a \fIPID\fR is specified without an \fIFD\fR, then that process will be +watched, and all regular files and block devices it opens will be shown with +a progress bar. +.IP +All remaining non-option arguments will also be treated as +\fIPID\fRs or as \fIPID\fR:\fIFD\fR pairs. +.IP +The \fBpv\fR process will exit when all \fIFD\fRs have either changed to a +different file, changed read/write mode, or have closed, and all \fIPID\fRs +(without a specific \fIFD\fR) have exited. .TP .BI \-R\ PID \fR,\ \fB\-\-remote\ PID Remotely control another instance of \fBpv\fR with process ID \fIPID\fR, diff --git a/docs/pv.1.md b/docs/pv.1.md index dfc62fa..9d539f5 100644 --- a/docs/pv.1.md +++ b/docs/pv.1.md @@ -6,7 +6,7 @@ pv - monitor the progress of data through a pipe **pv** \[*OPTION*\]\... \[*FILE*\]\... -**pv** **-d**\|**\--watchfd** *PID*\[:*FD*\] \[*OPTION*\]\... +**pv** \[*OPTION*\]\... **-d**\|**\--watchfd** *PID*\[:*FD*\]\... **pv** **-R**\|**\--remote** *PID* \[*OPTION*\]\... @@ -364,14 +364,19 @@ are explicitly switched on will be shown. **-d PID\[:FD\], \--watchfd PID\[:FD\]** : Instead of transferring data, watch file descriptor *FD* of process - *PID*, and show its progress. The **pv** process will exit when *FD* - either changes to a different file, changes read/write mode, or is - closed; other data transfer modifiers - and remote control - may not - be used with this option. + *PID*, and show its progress. Other data transfer modifiers - and + remote control - may not be used with this option. - If only a *PID* is specified, then that process will be watched, and - all regular files and block devices it opens will be shown with a - progress bar. The **pv** process will exit when process *PID* exits. + If a *PID* is specified without an *FD*, then that process will be + watched, and all regular files and block devices it opens will be + shown with a progress bar. + + All remaining non-option arguments will also be treated as *PID*s or + as *PID*:*FD* pairs. + + The **pv** process will exit when all *FD*s have either changed to a + different file, changed read/write mode, or have closed, and all + *PID*s (without a specific *FD*) have exited. **-R PID, \--remote PID**