Skip to content

Releases: alexflint/go-arg

v1.6.0

12 Jul 11:51
a36ed1e
Compare
Choose a tag to compare

Hey friends, here is the latest go-arg. What fun. I enjoy maintaining this library a lot. Lots of contributions from new contributors since last release -- check out new contributors section below. Very impressive work everyone.

I'm working on completions support for this library. It's going to be a separate library, in a separate repository, that will (if all goes according to plan) be a general-purpose cross-language cross-shell completion-support binary. I'll then add some options in this library to make use of that project, probably mostly in the form of documentation and examples rather than any significant changes to default behavior. If you'd like to give input on any of that, please reach out via email (see email address in my github profile).

As always, sorry for all the open issues and un-merged PRs!

What's Changed

  • Use standard exit status code for usage errors by @hhromic in #256
  • Fix usage when using custom version flag by @hhromic in #224
  • Move program version from usage to help by @hhromic in #259
  • Fix help text for positional args with default and env var by @hhromic in #262
  • Allow passing the string "--" twice or more by @alexflint in #273
  • Add support for setting a global env var prefix by @hhromic in #258
  • Make field name output consistent when using placeholders by @zanvd in #276
  • Fix Missing Global Options by @Areson in #278
  • Improve handling of negative numbers by @alexflint in #285

New Contributors

Full Changelog: v1.6.0...v1.5.2

v1.5.1

28 Jun 15:11
bee5cf5
Compare
Choose a tag to compare
  • Fixes a bug introduced in v1.5.0 where bad struct tags and other parser-level initialization problems would result in a crash rather than a clean exit in MustParse (thanks @hhromic !)

Version 1.5.0

12 May 14:07
dfca71d
Compare
Choose a tag to compare
  • Argument structs can define Description() and Epilogue(), which are added to the usage string

  • Subcommands can have multiple aliases like this:

var args struct {
    Remove *struct{} `arg:"subcommand:remove|rm|r" help:"remove something from somewhere"`
}
  • Improves formatting of usage string when the placeholder tag is set to empty string

  • Do not handle --version when the args struct lacks a Version() function

  • Add StructSubcommands to Config struct

Version 1.4.3

16 Feb 22:12
f0f44b6
Compare
Choose a tag to compare
  • Correctly brackets non-required positional arguments in usage strings
  • Fixes help and usage strings for subcommands.
  • Add native support for url.URL via go-scalar
  • Add environment variables names to error messages when relevant

Version 1.4.2

25 May 04:53
eb0393e
Compare
Choose a tag to compare

This patch release fixes a regression in which unexported embedded structs were mistakenly being ignored.

Version 1.4.1

21 Apr 02:12
679be43
Compare
Choose a tag to compare

Minor fix for case where an environment variable containing an empty string is parsed into a slice or map.

Version 1.4.0

20 Apr 19:30
9d937ba
Compare
Choose a tag to compare
  • Adds support for parsing into a map (see #149)
  • Adds support for options that have no --long version, only a -s short version (see #137)

Version 1.3.0

23 Feb 19:41
e9c71eb
Compare
Choose a tag to compare
  • Added the placeholder tag
  • Improved usage strings when using subcommands
  • Improved documentation on using subcommands

Version 1.2.0

22 Oct 06:43
c0c7a3b
Compare
Choose a tag to compare

This version introduces a new way to specify default values for arguments. The old way still works too.

Version 1.1.0

07 Aug 00:00
8baf704
Compare
Choose a tag to compare

This version adds support for subcommands. See https://github.com/alexflint/go-arg#subcommands