Skip to content

v0.8.0

Choose a tag to compare

@dbohdan dbohdan released this 28 Oct 08:28
· 129 commits to master since this release

Breaking changes to the CLI

The argument syntax has changed. -xbar and --foo=bar are no longer accepted. Please use -x bar and --foo bar. Short flags can also no longer be combined, except for -vv and -vvv. See the technical details below for why this change was made.

Other changes:

  • Removed -n and --tries. You can use either -a or --attempts.
  • Changed the -d/--delay behavior to extend the maximum delay when it is shorter.
  • Increased the default number of attempts from 5 to 10.

Logging improvements

  • Added verbosity level 3 to display internal configuration on startup.
  • Improved duration formatting to remove trailng zeroes and units. 1h0m0s now displays as 1h. Zero durations show as 0 instead of 0s.

Technical details about the CLI

This release introduces a custom argument parser to address issues we had with Kong 1.2.1 (negative numbers treated as flags—alecthomas/kong#315; passthrough passing through a flag as the command—alecthomas/kong#463). After evaluating several Go CLI libraries as potential alternatives, I found that none of them could fully replicate what we did with argparse in Python. The issues with other libraries center around passthrough and a lack of customization (for example, having an easy way to hide a default value). Since our needs are pretty simple—no subcommands or mutual exclusion logic—I came to the conclusion that a custom parser would be more maintainable than working around the limitations of existing libraries.