Skip to content

pymander/maybe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

maybe

A simple command line utility that succeeds sometimes.

Installation

There are pre-built binaries available on the project's release page. You can install one of those by downloading it, making it executable, and sticking it somewhere in your shell's command search path.

To install from source, you will need to install Go, at least version 1.20. You might as well just get the newest one, you won't regret it.

With Go installed, you can do the remote install thing with just one step:

go install github.com/pymander/maybe@latest

Or go slow and steady and build from source:

git clone https://github.com/pymander/maybe
cd maybe
go build

The maybe binary will be installed to $GOPATH/bin when using go install, or in the current directory when using go build.

Usage

  -chance int
        Percent chance from 1 to 99 (default 50)
  -extra
        Be extra random, cryptographically so
  -moon
        Weight chances based on the phase of the Moon
  -verbose
        Be noisy
  -version
        Print the current version

The percent chance is used to determine whether maybe exits with a 0 or a 1. This lets you create, for example, cron jobs that have a chance of running, but won't run all the time. You can do something like this:

maybe -chance 75 && echo Hello world

Who knows what crazy things you only want to happen part of the time?

About

A simple command line utility that succeeds sometimes.

Resources

License

Stars

3 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages