1 .\" Copyright (c) 2013-2014 Devin Teske
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .Nd stream data from stdin or multiple paths with dialog progress view
42 .Op Ar [bytes2:]label2 path2 ...
45 provides a dialog progress view, allowing a user to see current throughput rate
46 and total data transferred for one or more streams.
50 utility has two main modes for processing input.
52 The default input mode, without
55 reads bytes from standard input.
56 A label for the data must be provided.
58 The secondary input mode, with
62 .Pq up to 2047 or Dq ARG_MAX/2-1 ,
65 Data read in either mode is either thrown away
67 sent to a spawned instance of the program specified via
69 or sent to a unique file specified by
74 progress is displayed using one of
83 The following options are available:
84 .Bl -tag -width ".Fl b Ar backtitle"
88 below the file progress indicator(s).
92 on the backdrop, at top-left, behind the dialog widget.
95 this is displayed inside the window
97 followed by a separator line.
100 Print dialog prompt data to standard out and provide additional debugging on
103 Do not use the default interface of
105 but instead spawn an instance of
111 environment variable or simply
115 Produce a short syntax usage with brief option descriptions and exit.
116 Output is produced on standard error.
118 Customize the single-file format string used to update the status line.
119 Ignored when using either
123 which lack the ability to display the status line
124 .Pq containing bytes/rate/thread information .
127 .Dq Li %'10lli bytes read @ %'9.1f bytes/sec. .
128 This format is used when handling one file.
130 Customize the multi-file format string used to update the status line.
131 Ignored when using either
135 which lack the ability to display the status line
136 .Pq containing bytes/rate/thread information .
139 .Dq Li %'10lli bytes read @ %'9.1f bytes/sec. [%i/%i busy/wait] .
140 This format is used when handling more than one file.
142 Line mode. Read lines from input instead of bytes.
145 If negative, shrink to longest label width.
148 Instead of reading bytes from standard input, read from a set of paths
149 .Pq one for each label .
150 By default, each path is processed sequentially in the order given.
154 progress indicators per screen.
155 If zero, display as many as possible.
156 If negative, only display the main progress indicator.
161 If enabled, stop reading known-length inputs when input reaches stated length.
165 The first occurrence of
170 will be replaced with the
176 above the file progress indicator(s).
178 Mini-progressbar size.
179 If negative, don't display mini-progressbars
180 .Pq only the large overall progress indicator is shown .
181 If zero, auto-adjust based on number of files to read.
182 When zero and only one file to read, defaults to -1.
183 When zero and more than one file to read, defaults to 17.
188 Note that if you use this option at the same time as
191 .Ql Fl b Ar backtitle ,
196 are effectively switched
197 .Pq see BUGS section below .
200 Simulate reading a number of bytes, divided evenly across the number of files,
201 while stepping through each percent value of each file to process.
205 .Pq to override, use Ql Fl u Ar format .
206 No data is actually read.
215 disables status line updates.
216 If negative, update the status line as fast as possible.
217 Ignored when using either
221 which lack the ability to display the status line
222 .Pq containing bytes/rate/thread information .
231 to bump the dialog width.
232 Prompts wider than the maximum width will wrap
233 .Pq unless using Xr Xdialog 1 ; see BUGS section below .
238 and send it data that has been read.
245 is executed once for each
248 The first occurrence of
253 will be replaced with the
257 Enable X11 mode by using
265 The following environment variables are referenced by
267 .Bl -tag -width ".Ev USE_COLOR"
269 Override command string used to launch
274 .Pq requires Ql Fl X ;
282 If set and non-NULL, path to
288 is either not set or NULL, used as a prefix to
290 .Pq i.e., Ql $HOME/.dialogrc .
292 If set and NULL, disables the use of color when using
294 .Pq does not apply to Xr Xdialog 1 .
307 .Bl -tag -width ".Pa $HOME/.dialogrc" -compact
308 .It Pa $HOME/.dialogrc
312 Simple example to show how fast
315 .Pq usually about ten-million per-second; your results may vary :
316 .Bd -literal -offset indent
320 Display progress while timing how long it takes
322 to produce a half-billion lines
323 .Pq usually under one minute; your results may vary :
324 .Bd -literal -offset indent
325 time yes | dpv -Nl 500000000:yes
328 An example to watch how quickly a file is transferred using
330 .Bd -literal -offset indent
331 dpv -x "nc -w 1 somewhere.com 3000" -m label file
334 A similar example, transferring a file from another process and passing the
337 .Bd -literal -offset indent
338 cat file | dpv -x "nc -w 1 somewhere.com 3000" 12345:label
341 A more complicated example:
342 .Bd -literal -offset indent
343 tar cf - . | dpv -x "gzip -9 > out.tgz" \\
344 $( du -s . | awk '{print $1 * 1024}' ):label
347 Taking an image of a disk:
348 .Bd -literal -offset indent
349 dpv -o disk-image.img -m label /dev/ada0
352 Writing an image back to a disk:
353 .Bd -literal -offset indent
354 dpv -o /dev/ada0 -m label disk-image.img
358 .Bd -literal -offset indent
359 dpv -o /dev/md42 < /dev/zero
365 .Ql Fl -title Ar title
366 .Pq see above Ql Fl t Ar title
368 .Ql Fl -backtitle Ar backtitle
369 .Pq see above Ql Fl b Ar backtitle ,
370 displays the backtitle in place of the title and vice-versa.
373 does not wrap long prompt texts received after initial launch.
374 This is a known issue with the
380 does not display the first character after a series of escaped escape-sequences
381 (e.g., ``\\\\n'' produces ``\\'' instead of ``\\n'').
382 This is a known issue with
389 If your application ignores
391 when set and NULL before calling
393 with color escape sequences anyway,
397 may not render properly.
398 Workaround is to detect when
400 is set and NULL and either not use color escape sequences at that time or use
408 forcing interpretation of color sequences.
411 which renders the color escape sequences as plain text.
414 embedded "\\Z" sequences
418 for additional information.
427 utility first appeared in
430 .An Devin Teske Aq dteske@FreeBSD.org