wayback
wayback copied to clipboard
Bump github.com/spf13/cobra from 1.4.0 to 1.5.0
Bumps github.com/spf13/cobra from 1.4.0 to 1.5.0.
Release notes
Sourced from github.com/spf13/cobra's releases.
v1.5.0
Spring 2022 Release 🌥️
Hello everyone! Welcome to another release of cobra. Completions continue to get better and better. This release adds a few really cool new features. We also continue to patch versions of our dependencies as they become available via dependabot. Happy coding!
Active help 👐🏼
Shout out to
@marckhouzamfor a big value add: Active Help spf13/cobra#1482. With active help, a program can provide some inline warnings or hints for users as they hit tab. Now, your CLIs can be even more intuitive to use!Currently active help is only supported for bash V2 and zsh. Marc wrote a whole guide on how to do this, so make sure to give it a good read to learn how you can add this to your cobra code! https://github.com/spf13/cobra/blob/master/active_help.md
Group flags 🧑🏼🤝🧑🏼
Cobra now has the ability to mark flags as required or exclusive as a group. Shout out to our newest maintainer
@johnSchnakefor this! spf13/cobra#1654 Let's say you have ausernameflag that MUST be partnered with apasswordflag. Well, now, you can enforce those as being required together:rootCmd.Flags().StringVarP(&u, "username", "u", "", "Username (required if password is set)") rootCmd.Flags().StringVarP(&pw, "password", "p", "", "Password (required if username is set)") rootCmd.MarkFlagsRequiredTogether("username", "password")Flags may also be marked as "mutally exclusive" with the
MarkFlagsMutuallyExclusive(string, string ... )command API. Refer to our user guide documentation for further info!Completions 👀
- Add backwards-compatibility tests for legacyArgs() by
@marckhouzamin spf13/cobra#1547- feat: Add how to load completions in your current zsh session by
@ondrejsikain spf13/cobra#1608- Introduce FixedCompletions by
@emersionin spf13/cobra#1574- Add shell completion to flag groups by
@marckhouzamin spf13/cobra#1659- Modify brew prefix path in macOS system by
@imxwin spf13/cobra#1719- perf(bash-v2): use backslash escape string expansion for tab by
@scopin spf13/cobra#1682- style(bash-v2): out is not an array variable, do not refer to it as such by
@scopin spf13/cobra#1681- perf(bash-v2): standard completion optimizations by
@scopin spf13/cobra#1683- style(bash): out is not an array variable, do not refer to it as such by
@scopin spf13/cobra#1684- perf(bash-v2): short-circuit descriptionless candidate lists by
@scopin spf13/cobra#1686- perf(bash-v2): speed up filtering entries with descriptions by
@scopin spf13/cobra#1689- perf(bash-v2): speed up filtering menu-complete descriptions by
@scopin spf13/cobra#1692- fix(bash-v2): skip empty completions when filtering descriptions by
@scopin spf13/cobra#1691- perf(bash-v2): read directly to COMPREPLY on descriptionless short circuit by
@scopin spf13/cobra#1700- fix: Don't complete _command on zsh by
@twpaynein spf13/cobra#1690- Improve fish_completions code quality by
@t29kidain spf13/cobra#1515- Fix handling of descriptions for bash v3 by
@marckhouzamin spf13/cobra#1735- undefined or nil Args default to ArbitraryArgs by
@umarcorin spf13/cobra#1612- Add Command.SetContext by
@joshcarpin spf13/cobra#1551- Wrap printf tab with quotes by
@PapaCharliein spf13/cobra#1665Documentation 📝
- Fixed typos in completions docs -
@cuishuangspf13/cobra#1625- Removed
CHANGELOG.mdas it isn't updated -@johnSchnakespf13/cobra#1634- Minor typo fix in
shell_completion.md-@danieldnspf13/cobra#1678- Changed branch name in the cobra generator link to 'main' -
@skywalker2909spf13/cobra#1645- Fix Command.Context comment by
@katexochenin spf13/cobra#1639
... (truncated)
Commits
06b06a9Bump golangci/golangci-lint-action from 3.1.0 to 3.2.0 (#1697)5f2ec3cUpdate shell completion to respect flag groups (#1659)b9ca594use errors.Is() to check for errors (#1730)ea94a3dundefined or nil Args default to ArbitraryArgs (#1612)7c9831dFix handling of descriptions for bash v3 (#1735)ed7bb9dAdd unit test for fish completion (#1515)f464d6cAdd Active Help support (#1482)7dc8b00Bump actions/setup-go from 2 to 3 (#1660)87ea180Modify brew prefix path in macOS system (#1719)ca8e3c2Add Pulumi as a project using cobra (#1720)- Additional commits viewable in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Codecov Report
Merging #179 (b3417c7) into main (22b3bdb) will not change coverage. The diff coverage is
n/a.
@@ Coverage Diff @@
## main #179 +/- ##
=======================================
Coverage 44.74% 44.74%
=======================================
Files 40 40
Lines 4921 4921
=======================================
Hits 2202 2202
Misses 2450 2450
Partials 269 269
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 22b3bdb...b3417c7. Read the comment docs.
Looks like github.com/spf13/cobra is up-to-date now, so this is no longer needed.