2016-01-01 22:12:40 +01:00
. \" generated with Ronn/v0.7.3
. \" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "WAIT" "1" "January 2016" "" "fisherman"
.
.SH "NAME"
\fB wait\fR \- Run commands and wait with a spin
.
.SH "SYNOPSIS"
\fB wait\fR \fI commands\fR [\fB \- \- spin\fR =\fI arc\fR |\fI star\fR |\fI pipe\fR |\fI ball\fR |\fI flip\fR |\fI mixer\fR |\fI caret\fR |\fI bar1~3\fR ]
.
.br
\fB wait\fR \fI commands\fR [\fB \- \- time\fR =interval] [\fB \- \- log\fR =file] [\fB \- \- format\fR =format] [\fB \- \- help\fR ]
.
.SH "DESCRIPTION"
Run \fI commands\fR as a background process and wait until the job has finished\. Any output to standard error indicates \fB wait\fR to return \fB 1\fR once is done\. While it waits, a customizable spinner is displayed in the command line\.
.
.SH "OPTIONS"
.
.TP
2016-01-10 08:01:07 +01:00
\fB \- s \- \- spin=style|string\fR
Set spinner style\. See \fB Styles\fR for a list of styles and instructions on how to use your own character sequences, progress bar usage, etc\.
2016-01-01 22:12:40 +01:00
.
.TP
2016-01-10 08:01:07 +01:00
\fB \- t \- \- time=interval\fR
2016-01-01 22:12:40 +01:00
Set spinner transition time delay in \fI seconds\fR \. A large value will refresh the spinner more slowly\. You may use decimal numbers to represent smaller numbers\.
.
.TP
2016-01-10 08:01:07 +01:00
\fB \- l \- \- log=file\fR
2016-01-01 22:12:40 +01:00
Output standard error to given \fI file\fR \.
.
.TP
2016-01-10 08:01:07 +01:00
\fB \- f \- \- format=format\fR
2016-01-01 22:12:40 +01:00
Use given \fI format\fR to display the spinner\. The default format is \fB "\e r@"\fR where \fB @\fR represents the spinner token and \fB \e r\fR a carriage return, used to refresh / erase the line\.
.
.TP
2016-01-10 08:01:07 +01:00
\fB \- h \- \- help\fR
2016-01-01 22:12:40 +01:00
Show usage help\.
.
.SH "STYLES"
2016-01-10 08:01:07 +01:00
The following styles are supported via \fB \- \- spin=style\fR :
2016-01-01 22:12:40 +01:00
.
.IP "\(bu" 4
arc, star, pipe, ball, flip, mixer, caret
.
.IP "\(bu" 4
bar1~3
.
.IP "" 0
.
.SS "CUSTOMIZATION"
In addition to the default styles, you can specify a string of character tokens to be used each per spinner refresh cycle\.
.
.P
For example \fB \- \- spin=12345\fR will display the numbers from 1 to 5, and \fB \- \- spin=\. \- \- format=@\fR an increasing sequence of dots\.
.
.SS "PROGRESS BARS"
2016-01-10 08:01:07 +01:00
Display a progress bar with a percent indicator using \fB \- \- spin=bar1~3\fR :
2016-01-01 22:12:40 +01:00
.
.IP "\(bu" 4
bar1: [=====] \fI num\fR %
.
.IP "\(bu" 4
bar2: [#####] \fI num\fR %
.
.IP "\(bu" 4
bar3: \. \. \. \. \. \. \. \fI num\fR %
.
.IP "" 0
.
.P
You can customize the appearance as follows:
.
.IP "" 4
.
.nf
\- \- spin=bar:<opening token><fill token><empty slot token><closing token>[%]
.
.fi
.
.IP "" 0
.
.P
For example:
.
.IP "" 4
.
.nf
\- \- spin="bar:[+\- ]%"
\- \- spin="bar:(@o)"
\- \- spin="bar:||_|"
.
.fi
.
.IP "" 0
.
.SH "EXAMPLES"
Run a lengthy operation as a background job and display a spinning pipe character until it is finished\.
.
.IP "" 4
.
.nf
2016-01-10 08:01:07 +01:00
wait \- \- spin=pipe "curl \- sS $URL"
2016-01-01 22:12:40 +01:00
.
.fi
.
.IP "" 0
.
.P
Output any errors to \fI debug\. txt\fR \.
.
.IP "" 4
.
.nf
2016-01-10 08:01:07 +01:00
if not wait \- \- spin=pipe \- \- log=debug\. txt "curl \- sS $URL"
2016-01-01 22:12:40 +01:00
return 1
end
.
.fi
.
.IP "" 0
.
.SH "SEE ALSO"
2016-01-10 08:01:07 +01:00
sleep(1)
2016-01-01 22:12:40 +01:00
.
.br