Releases: FollowTheProcess/cli
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]
v0.14.0
Changes
- Update FollowTheProcess/ci action to v3 (#160) @renovate[bot]
- Configure Renovate (#157) @renovate[bot]
🚀 Features
- Migrate this project to the vanity URL (#162) @FollowTheProcess
👷 Continuous Integration
- Update golangci-lint config to v2 (#155) @FollowTheProcess
📦 Dependencies
- Bump github.com/FollowTheProcess/snapshot from 0.4.2 to 0.5.0 (#156) @dependabot[bot]
- Bump github.com/FollowTheProcess/test from 0.20.3 to 0.21.0 (#154) @dependabot[bot]
- Bump github.com/FollowTheProcess/test from 0.20.2 to 0.20.3 (#153) @dependabot[bot]
v0.13.0
Changes
- Remove the ability to set a custom VersionFunc (#148) @FollowTheProcess
🚀 Features
- Allow
Countflags to be directly passed an argument e.g.--verbosity=3(#146) @FollowTheProcess - Align flag non-zero default values with the tabwriter (#142) @FollowTheProcess
🪲 Fixes
- Remove unnecessary newline after examples (#150) @FollowTheProcess
🐎 Performance
- Pre-compute the size of the buffer to hold
--versiontext (#152) @FollowTheProcess - Optimise help and usage buffer size (#149) @FollowTheProcess
🚨 Testing
- Add
t.Parallel()to all tests and subtests (#141) @FollowTheProcess
📚 Documentation
- Better document flaggable types as well as general usage (#147) @FollowTheProcess
- Use charmbracelet/freeze to render the demo image (#144) @FollowTheProcess
- Add an example of slice flags to the subcommands demo (#143) @FollowTheProcess
💄 Style
- Remove unneeded t.Helper calls (#145) @FollowTheProcess
📦 Dependencies
- Update dependencies in go.mod (#151) @FollowTheProcess