Diffstat (limited to 'man/man1/maybe.1')
1 files changed, 25 insertions, 0 deletions
diff --git a/man/man1/maybe.1 b/man/man1/maybe.1
new file mode 100644
@@ -0,0 +1,25 @@
+.TH MAYBE 1 "November 2015" "Manual page for maybe"
+\- possibly exit with success
+.B maybe [-hv] [-d DENOMINATOR]
+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
+This just uses integer division with Bash's special RANDOM variable, so it's
+far from scientific precision.
+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).
+ $ maybe
+ $ maybe -v -d3
+.SH SEE ALSO
+Tom Ryder <email@example.com>