Skip to content

Commit

Permalink
chore(deps): update module github.com/spf13/cobra to v1.5.0 (googleap…
Browse files Browse the repository at this point in the history
…is#1128)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/spf13/cobra](https://togithub.com/spf13/cobra) | require | minor | `v1.4.0` -> `v1.5.0` |

---

### Release Notes

<details>
<summary>spf13/cobra</summary>

### [`v1.5.0`](https://togithub.com/spf13/cobra/releases/tag/v1.5.0)

[Compare Source](https://togithub.com/spf13/cobra/compare/v1.4.0...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 [@&#8203;marckhouzam](https://togithub.com/marckhouzam) for 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 [@&#8203;johnSchnake](https://togithub.com/johnSchnake) for this! [spf13/cobra#1654 Let's say you have a `username` flag that ***MUST*** be partnered with a `password` flag. Well, now, you can enforce those as being required together:

```go
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](https://togithub.com/spf13/cobra/blob/master/user_guide.md) for further info!

#### Completions 👀

-   Add backwards-compatibility tests for legacyArgs() by [@&#8203;marckhouzam](https://togithub.com/marckhouzam) in [spf13/cobra#1547
-   feat: Add how to load completions in your current zsh session by [@&#8203;ondrejsika](https://togithub.com/ondrejsika) in [spf13/cobra#1608
-   Introduce FixedCompletions by [@&#8203;emersion](https://togithub.com/emersion) in [spf13/cobra#1574
-   Add shell completion to flag groups by [@&#8203;marckhouzam](https://togithub.com/marckhouzam) in [spf13/cobra#1659
-   Modify brew prefix path in macOS system by [@&#8203;imxw](https://togithub.com/imxw) in [spf13/cobra#1719
-   perf(bash-v2): use backslash escape string expansion for tab by [@&#8203;scop](https://togithub.com/scop) in [spf13/cobra#1682
-   style(bash-v2): out is not an array variable, do not refer to it as such by [@&#8203;scop](https://togithub.com/scop) in [spf13/cobra#1681
-   perf(bash-v2): standard completion optimizations by [@&#8203;scop](https://togithub.com/scop) in [spf13/cobra#1683
-   style(bash): out is not an array variable, do not refer to it as such by [@&#8203;scop](https://togithub.com/scop) in [spf13/cobra#1684
-   perf(bash-v2): short-circuit descriptionless candidate lists by [@&#8203;scop](https://togithub.com/scop) in [spf13/cobra#1686
-   perf(bash-v2): speed up filtering entries with descriptions by [@&#8203;scop](https://togithub.com/scop) in [spf13/cobra#1689
-   perf(bash-v2): speed up filtering menu-complete descriptions by [@&#8203;scop](https://togithub.com/scop) in [spf13/cobra#1692
-   fix(bash-v2): skip empty completions when filtering descriptions by [@&#8203;scop](https://togithub.com/scop) in [spf13/cobra#1691
-   perf(bash-v2): read directly to COMPREPLY on descriptionless short circuit by [@&#8203;scop](https://togithub.com/scop) in [spf13/cobra#1700
-   fix: Don't complete \_command on zsh by [@&#8203;twpayne](https://togithub.com/twpayne) in [spf13/cobra#1690
-   Improve fish_completions code quality by [@&#8203;t29kida](https://togithub.com/t29kida) in [spf13/cobra#1515
-   Fix handling of descriptions for bash v3 by [@&#8203;marckhouzam](https://togithub.com/marckhouzam) in [spf13/cobra#1735
-   undefined or nil Args default to ArbitraryArgs by [@&#8203;umarcor](https://togithub.com/umarcor) in [spf13/cobra#1612
-   Add Command.SetContext by [@&#8203;joshcarp](https://togithub.com/joshcarp) in [spf13/cobra#1551
-   Wrap printf tab with quotes by [@&#8203;PapaCharlie](https://togithub.com/PapaCharlie) in [spf13/cobra#1665

#### Documentation 📝

-   Fixed typos in completions docs - [@&#8203;cuishuang](https://togithub.com/cuishuang) [spf13/cobra#1625
-   Removed `CHANGELOG.md` as it isn't updated - [@&#8203;johnSchnake](https://togithub.com/johnSchnake) [spf13/cobra#1634
-   Minor typo fix in `shell_completion.md` - [@&#8203;danieldn](https://togithub.com/danieldn) [spf13/cobra#1678
-   Changed branch name in the cobra generator link to 'main' - [@&#8203;skywalker2909](https://togithub.com/skywalker2909) [spf13/cobra#1645
-   Fix Command.Context comment by [@&#8203;katexochen](https://togithub.com/katexochen) in [spf13/cobra#1639
-   Change appropriate links from http:// to https:// where applicable - [@&#8203;deining](https://togithub.com/deining) [spf13/cobra#1695

#### Testing & CI ⚙️

-   Test on Golang 1.18 - [@&#8203;umarcor](https://togithub.com/umarcor) [spf13/cobra#1635
-   Use `RICHGO_FORCE_COLOR` - [@&#8203;umarcor](https://togithub.com/umarcor) [spf13/cobra#1647
-   Adds size labeler GitHub action by [@&#8203;jpmcb](https://togithub.com/jpmcb) in [spf13/cobra#1610
-   Update `stale-bot` settings - [@&#8203;jpmcb](https://togithub.com/jpmcb) [spf13/cobra#1609

#### Beep boop, bot commits 🤖

-   Bumped golangci/golangci-lint-action from 3.1.0 to 3.2.0 - [@&#8203;dependabot](https://togithub.com/dependabot) [spf13/cobra#1697
-   Bump codelytv/pr-size-labeler from 1.8.0 to 1.8.1 - [@&#8203;dependabot](https://togithub.com/dependabot) [spf13/cobra#1661
-   Bump actions/stale from 1 to 5 by [@&#8203;dependabot](https://togithub.com/dependabot) in [spf13/cobra#1618
-   Bump actions/cache from 2 to 3 by [@&#8203;dependabot](https://togithub.com/dependabot) in [spf13/cobra#1640
-   Bump actions/labeler from 3 to 4 by [@&#8203;dependabot](https://togithub.com/dependabot) in [spf13/cobra#1620
-   Bump golangci/golangci-lint-action from 2 to 3.1.0 by [@&#8203;dependabot](https://togithub.com/dependabot) in [spf13/cobra#1615
-   Bump actions/checkout from 2 to 3 by [@&#8203;dependabot](https://togithub.com/dependabot) in [spf13/cobra#1619
-   Bump github.com/cpuguy83/go-md2man/v2 from 2.0.1 to 2.0.2 by [@&#8203;dependabot](https://togithub.com/dependabot) in [spf13/cobra#1688
-   Bump actions/setup-go from 2 to 3 by [@&#8203;dependabot](https://togithub.com/dependabot) in [spf13/cobra#1660

#### Misc 💭

-   Use `errors.Is()` to check for errors - [@&#8203;Luap99](https://togithub.com/Luap99) [spf13/cobra#1730
-   Prefer ReplaceAll instead of Replace(..., -1) by [@&#8203;WhyNotHugo](https://togithub.com/WhyNotHugo) in [spf13/cobra#1530
-   Add Kubescape to projects - [@&#8203;avinashupadhya99](https://togithub.com/avinashupadhya99) [spf13/cobra#1642
-   Add Pulumi as a project using cobra by [@&#8203;iwahbe](https://togithub.com/iwahbe) in [spf13/cobra#1720
-   Add Polygon Edge as a project using Cobra by [@&#8203;zivkovicmilos](https://togithub.com/zivkovicmilos) in [spf13/cobra#1672

Shoutout to *ALL* our contributors (and all the new first time contributors!!) - great work everyone!! Cobra and it's huge impact wouldn't be possible without you 👏🏼  🚀  🐍

**Full Changelog**: spf13/cobra@v1.4.0...v1.5.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/gapic-showcase).
  • Loading branch information
renovate-bot committed Jun 27, 2022
1 parent 6c5c12c commit 7e9ef51
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -10,7 +10,7 @@ require (
github.com/gorilla/mux v1.8.0
github.com/iancoleman/strcase v0.2.0
github.com/soheilhy/cmux v0.1.5
github.com/spf13/cobra v1.4.0
github.com/spf13/cobra v1.5.0
github.com/spf13/viper v1.12.0
golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f
Expand Down
6 changes: 3 additions & 3 deletions go.sum
Expand Up @@ -98,7 +98,7 @@ github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWH
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
Expand Down Expand Up @@ -367,8 +367,8 @@ github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo=
github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo=
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU=
github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q=
github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g=
github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU=
github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM=
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
Expand Down

0 comments on commit 7e9ef51

Please sign in to comment.