Releases: FollowTheProcess/cli
v0.20.0
Changes
🚀 Features
- Support *url.URL in flags as well as arguments (#201) @FollowTheProcess
- Allow associating env vars with flags (#200) @FollowTheProcess
🪲 Fixes
- Use
default:in arg descriptions too, standardising the format (#208) @FollowTheProcess
🐎 Performance
- Performance wins across the board (#211) @FollowTheProcess
🚨 Testing
- Cover a bunch of edge cases, most of which already passed (#207) @FollowTheProcess
🔨 Refactoring
- Add a
Sortediterator on flag set for help text and keepAllunordered (#210) @FollowTheProcess - Make
Flag[T]a pointer in prep for some future work (#209) @FollowTheProcess
📦 Dependencies
- Update module go.followtheprocess.codes/test to v1.4.0 (#206) @renovate[bot]
- Update module go.followtheprocess.codes/test to v1.2.2 (#205) @renovate[bot]
- Update module go.followtheprocess.codes/snapshot to v0.10.0 (#202) @renovate[bot]
- Update module go.followtheprocess.codes/test to v1.2.0 (#203) @renovate[bot]
- Update FollowTheProcess/ci action to v4 (#198) @renovate[bot]
v0.19.0
Changes
🚀 Features
- Support shell completion via carapace spec generation (#197) @FollowTheProcess
📦 Dependencies
- Update release-drafter/release-drafter action to v7 (#196) @renovate[bot]
- Update crazy-max/ghaction-github-labeler action to v6 (#195) @renovate[bot]
v0.18.3
v0.18.2
Changes
🐎 Performance
- Tweak usage buffer sizes based on some of my cli tools (#191) @FollowTheProcess
📦 Dependencies
- Update module go.followtheprocess.codes/snapshot to v0.9.1 (#193) @renovate[bot]
- Update actions/checkout action to v6 (#192) @renovate[bot]
- Update module go.followtheprocess.codes/test to v1.1.0 (#190) @renovate[bot]
v0.18.1
Changes
🚀 Features
- Always align flag defaults in usage text (#187) @FollowTheProcess
🔨 Refactoring
- Refactor how flag usage is generated (#188) @FollowTheProcess
📦 Dependencies
- Update module go.followtheprocess.codes/snapshot to v0.7.0 (#189) @renovate[bot]
v0.18.0
Changes
Made Flags follow the same Option customisation mechanism as Args, setting a default value in the cli.Flag function signature is no longer required, a flag assumes it's zero value by default and may be overridden with cli.FlagDefault(T)
💥 Breaking Changes
- Breaking: Change the way flags are configured to be consistent with Args (#186) @FollowTheProcess
- Breaking: Change the signature of cmd.Run to pass a context.Context (#185) @FollowTheProcess
🚀 Features
- Add *url.URL as an argable type (#184) @FollowTheProcess
🔨 Refactoring
- Improve format.Slice by special casing the first element (#183) @FollowTheProcess
v0.17.0
Changes
This release breaks quite a bit of stuff, but for a good cause!
Goodbye []string and hello to type safe structs!
I've completed re-worked how positional arguments work, instead of getting the raw []string passed to the Run method, I've introduced a mechanism for declaring type-safe structs describing the positional arguments, which are then inferred using generics and parsed similar to how flags already worked.
As a result of this:
- I've dropped the
cli.Allowoption and all the argument validators as this new mechanism is much better and allows you to define exactly what
arguments you want and what types they are - The signature of the function provided to
cli.Runhas changed fromfunc(cmd *cli.Command, args []string) errortofunc(cmd *cli.Command) error - Raw positional arguments can still be obtained using
cmd.Args() cli.NoShortHandis nowflag.NoShortHandcli.FlagCountis nowflag.Count
See the updated README and the updated examples for how to change your code to match the new behaviour.
I've updated my projects that use this and the changes honestly aren't so bad
💥 Breaking Changes
- Breaking: Completely rework how positional arguments are handled (#178) @FollowTheProcess
- Breaking: Move FlagCount and Flaggable to a public flag package (#177) @FollowTheProcess
🚀 Features
- Breaking: Completely rework how positional arguments are handled (#178) @FollowTheProcess
- If a subcommand does not set a version, use the root command's version (#176) @FollowTheProcess
🚨 Testing
- Bump up test coverage (#181) @FollowTheProcess
🔨 Refactoring
- Centralise the tabwriter creation (#182) @FollowTheProcess
- Migrate internal/flag to the new parse/format mechanisms (#180) @FollowTheProcess
- Add new parse and format packages to reduce duplication (#179) @FollowTheProcess
v0.16.0
Changes
🚀 Features
- Don't show empty slices as flag default values in help (#175) @FollowTheProcess
- Tweak the title colour in help text (#173) @FollowTheProcess
📦 Dependencies
- Update module go.followtheprocess.codes/test to v1 (#174) @renovate[bot]
v0.15.0
Changes
🚀 Features
- Add extra padding after named arguments section in help text (#172) @FollowTheProcess
- Use hue for colouring and style (#171) @FollowTheProcess
- Add extra padding in subcommand section (#170) @FollowTheProcess
v0.14.1
Changes
- Ensure renovate runs
go mod tidyafter updates (#163) @FollowTheProcess
🚀 Features
- Add extra padding in examples and options section (#167) @FollowTheProcess
👷 Continuous Integration
- Update golangci-lint rules (#166) @FollowTheProcess
📦 Dependencies
- Update module go.followtheprocess.codes/test to v0.23.1 (#169) @renovate[bot]
- Update module go.followtheprocess.codes/snapshot to v0.6.1 (#168) @renovate[bot]
- Update module go.followtheprocess.codes/test to v0.23.0 (#165) @renovate[bot]
- Update actions/checkout action to v5 (#164) @renovate[bot]