backoff - retry command with increasing delay

A bloated version of backoff() { s=1; while ! eval "$@"; do sleep $s; s=$((s*2)); done; }, with some extra options.

Usage: backoff [ OPTION ... ] [ -- ] COMMANDLINE

  Evaluate COMMANDLINE at doubling interval until successful.

Options (nb: --option=value -o1 -abc syntax is not supported):
  -h, --help       Display usage instructions.
  -q, --quiet      Reduce verbosity (default: 1).
                   0: no output
                   1: print information before and after executing COMMANDLINE
                   2: also set -x for COMMANDLINE
  -v, --verbose    Increase verbosity.
  -i, --initial S  Start with a delay interval of S seconds (default: 1)
  -r, --reset S    If COMMANDLINE takes longer than S seconds to fail, reset
                   the interval to its initial value. This is useful for
                   things like reconnecting, where taking a long time to fail
                   is a kind of success. (default: never reset)

Madness? This is bash. Get backoff.