From 7b2392c4ad351986617c4b474bad6a3d9cd30627 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 3 Aug 2016 16:27:47 +1200 Subject: Change maybe(1) to POSIX sh, rename myb(1) --- man/man1/maybe.1 | 24 ------------------------ man/man1/myb.1 | 20 ++++++++++++++++++++ man/man1/try.1 | 4 ++-- 3 files changed, 22 insertions(+), 26 deletions(-) delete mode 100644 man/man1/maybe.1 create mode 100644 man/man1/myb.1 (limited to 'man') diff --git a/man/man1/maybe.1 b/man/man1/maybe.1 deleted file mode 100644 index 9fd90c8b..00000000 --- a/man/man1/maybe.1 +++ /dev/null @@ -1,24 +0,0 @@ -.TH MAYBE 1 "February 2016" "Manual page for maybe" -.SH NAME -.B maybe -\- possibly exit with success -.SH USAGE -.B maybe [-hv] [-d DENOMINATOR] -.SH DESCRIPTION -Like true(1) or false(1), but exits with success randomly with a given -probability. Good for using in tests. Exits with 2 rather than 1 on usage -errors. -.P -This just uses integer division with Bash's special RANDOM variable, so it's -far from scientific precision. -.P -Option -h gives help, option -v turns on verbose output, option -d specifies -the denominator for the probability; defaults to 2 (i.e. roughly equal chance -of success or failure). -.P - $ maybe - $ maybe -v -d3 -.SH SEE ALSO -true(1), false(1), try(1) -.SH AUTHOR -Tom Ryder diff --git a/man/man1/myb.1 b/man/man1/myb.1 new file mode 100644 index 00000000..ef9babc9 --- /dev/null +++ b/man/man1/myb.1 @@ -0,0 +1,20 @@ +.TH MYB 1 "August 2016" "Manual page for myb" +.SH NAME +.B myb +\- possibly exit with success +.SH USAGE +.B myb [DENOMINATOR] +.SH DESCRIPTION +Like true(1) or false(1), but exits with success randomly with a given +probability. Good for using in tests. Exits with 2 rather than 1 on usage +errors. +.P +The denominator defaults to 2 for a roughly equal chance of success or failure. +rndi(1) is used for the randomness. +.P + $ myb + $ myb 3 +.SH SEE ALSO +true(1), false(1), try(1), rndi(1) +.SH AUTHOR +Tom Ryder diff --git a/man/man1/try.1 b/man/man1/try.1 index d3dcd1de..15182436 100644 --- a/man/man1/try.1 +++ b/man/man1/try.1 @@ -14,8 +14,8 @@ of attempts; defaults to 3. Options may be terminated with --. The remaining arguments are the command to run. .P $ try gms - $ try -v -n3 maybe + $ try -v -n3 myb .SH SEE ALSO -maybe(1) +myb(1) .SH AUTHOR Tom Ryder -- cgit v1.2.3