Skip to content

Commit 0215933

Browse files
authored
Update docs for v1.3.0 (#31)
1 parent 9bbdb46 commit 0215933

File tree

1 file changed

+31
-16
lines changed

1 file changed

+31
-16
lines changed

README.md

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,27 @@
88

99
⏰ Rerun a command until it eventually succeeds, or doesn't!
1010

11-
## Installing
11+
## Installation
1212

13-
### Release binary
13+
Prebuilt binaries for several architectures can be found attached to any of the available [releases][github-release-link].
1414

15-
A prebuilt [release][github-release-link] binary can be downloaded by running:
16-
17-
```bash
18-
$ wget -q https://github.com/joshdk/retry/releases/download/v1.2.0/retry-linux-amd64.tar.gz
19-
$ tar -xf retry-linux-amd64.tar.gz
20-
$ sudo install retry /usr/bin/retry
15+
For Linux:
16+
```shell
17+
wget https://github.com/joshdk/retry/releases/download/v1.3.0/retry-linux-amd64.tar.gz
18+
tar -xf retry-linux-amd64.tar.gz
19+
sudo install retry /usr/bin/retry
2120
```
2221

23-
### From source
24-
25-
Alternatively, a development version of this tool can be installed by running:
22+
For Mac:
23+
```shell
24+
brew tap joshdk/tap
25+
brew install joshdk/tap/retry
26+
```
2627

27-
```bash
28-
$ go get -u github.com/joshdk/retry
28+
A development version can also be built directly from this repository.
29+
Requires that you already have a functional Go toolchain installed.
30+
```shell
31+
go install github.com/joshdk/retry@master
2932
```
3033

3134
## Motivations
@@ -54,6 +57,8 @@ Usage: retry [flags] command|url
5457
use exponential backoff when sleeping
5558
-consecutive int
5659
required number of back to back successes
60+
-delay duration
61+
initial delay period before tasks are run
5762
-invert
5863
wait for task to fail rather than succeed
5964
-jitter duration
@@ -67,7 +72,7 @@ Usage: retry [flags] command|url
6772
-task-time duration
6873
maximum time for a single attempt
6974
-version
70-
print the version "1.2.0" and exit
75+
print the version "1.3.0" and exit
7176
```
7277

7378
### Running a command
@@ -106,6 +111,16 @@ The `-max-time` flag limits the maximum total time that `retry` will run for. A
106111
> $ retry -max-time=60s https://example.com
107112
> ```
108113
114+
### Initial delay
115+
116+
The `-delay` flag inserts a one-time delay before initial starting to run commands.
117+
118+
> Run `wget https://example.com`, but start only after initially sleeping for 15 seconds.
119+
>
120+
> ```bash
121+
> $ retry -delay=15s wget https://example.com
122+
> ```
123+
109124
### Sleep between attempts
110125
111126
The `-sleep` flag inserts a timed delay between command runs.
@@ -168,10 +183,10 @@ Lastly, the `-quiet` flag silences all output (STDOUT and STDERR) from the comma
168183
169184
### Altogether now
170185
171-
> Run `wget https://example.com` a maximum of **10** times. Each run can take a maximum of **15 seconds**, and a total of **2 minutes**. Sleep for **5 seconds** between failures with exponential **backoff**. Lastly, require that the command succeeds **3 times** in a row.
186+
> Run `wget https://example.com` a maximum of **10** times. Each run can take a maximum of **15 seconds**, and a total of **2 minutes**. Delay for **15 seconds** before starting. Sleep for **5 seconds** between failures with exponential **backoff**. Lastly, require that the command succeeds **3 times** in a row.
172187
>
173188
> ```bash
174-
> $ retry -attempts=10 -task-time=15s -max-time=2m -sleep=5s -backoff -consecutive=3 wget https://example.com
189+
> $ retry -attempts=10 -task-time=15s -max-time=2m -delay=15s -sleep=5s -backoff -consecutive=3 wget https://example.com
175190
>```
176191
177192
## License

0 commit comments

Comments
 (0)