-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add count option for bool flags #1257
Conversation
I was looking for this functionality and was considering implementing it, but it looks like it's already been done 🎉 Is there any chance of getting this merged? I'm happy to help if there's anything else that needs to be done and @dearchap is short on time. |
I was just thinking about this feature the other day! Yay for a PR! I'll try to review it soon 🙏🏼 |
Can you review it soon @coilysiren . Its been more than a month since you suggested it. The code is pretty straightforward and also includes tests so the risk is very low. |
Ping @coilysiren |
@dearchap sorry for the conflicts! |
00a3cca
to
bf8c3d9
Compare
@meatballhat Merged my changes. There seems to be a circular dependency. The go generate wont run if it cant build the current code and the current code wont work unless the new spec has been generated. |
@dearchap You're absolutely right about the circular dependency 😭 I was hoping that we could "dogfood" the local version of urfave/cli in |
I'm late to the party, but I would have expected the count to be exposed via a context method. func main() {
app := &cli.App{
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "foo",
Usage: "foo greeting",
},
},
Action: func(cCtx *cli.Context) error {
fmt.Println("count", cCtx.Count("foo"))
return nil
},
}
if err := app.Run(os.Args); err != nil {
log.Fatal(err)
}
} |
@meatballhat Added an example in docs but for some reason it is taking the "args" tag to execute the app |
@icholy I think you are correct. It would be good to have a ctx.Count("flagName"). That introduces some additional complexity as we would probably want to have a CountableFlag interface etc etc. Let me see what I can do |
@icholy @meatballhat what do you think ? |
Co-authored-by: Dan Buch <dan@meatballhat.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/CycloneDX/cyclonedx-go](https://togithub.com/CycloneDX/cyclonedx-go) | require | minor | `v0.5.0` -> `v0.6.0` | | [github.com/g-rath/osv-detector](https://togithub.com/g-rath/osv-detector) | require | patch | `v0.7.1-0.20220815200046-7cbc516ebcad` -> `v0.7.1` | | [github.com/google/go-cmp](https://togithub.com/google/go-cmp) | require | patch | `v0.5.8` -> `v0.5.9` | | [github.com/jedib0t/go-pretty/v6](https://togithub.com/jedib0t/go-pretty) | require | patch | `v6.3.7` -> `v6.3.8` | | [github.com/spdx/tools-golang](https://togithub.com/spdx/tools-golang) | require | minor | `v0.2.0` -> `v0.3.0` | | [github.com/urfave/cli/v2](https://togithub.com/urfave/cli) | require | minor | `v2.11.1` -> `v2.16.3` | | [go](https://go.dev/) ([source](https://togithub.com/golang/go)) | golang | minor | `1.18` -> `1.19` | | [golang.org/x/exp](https://togithub.com/golang/exp) | require | digest | `145caa8` -> `b168a2c` | --- ### Release Notes <details> <summary>CycloneDX/cyclonedx-go</summary> ### [`v0.6.0`](https://togithub.com/CycloneDX/cyclonedx-go/releases/tag/v0.6.0) [Compare Source](https://togithub.com/CycloneDX/cyclonedx-go/compare/v0.5.2...v0.6.0) #### Changelog ##### Features - [`3cc319e`](https://togithub.com/CycloneDX/cyclonedx-go/commit/3cc319e20e6f9f6565c3365b62515575859ccf1f): feat: add support for bom links ([#​33](https://togithub.com/CycloneDX/cyclonedx-go/issues/33)) ([@​nscuro](https://togithub.com/nscuro)) ##### Fixes - [`5f285ff`](https://togithub.com/CycloneDX/cyclonedx-go/commit/5f285ff028c09f67aa62338dc06fe8e5a6932936): fix: add missing Properties ([#​39](https://togithub.com/CycloneDX/cyclonedx-go/issues/39)) ([@​desenna](https://togithub.com/desenna)) ##### Building and Packaging - [`d063798`](https://togithub.com/CycloneDX/cyclonedx-go/commit/d06379863c460d7627bccc0d911e667e867bd029): build(deps): bump actions/checkout from 3.0.0 to 3.0.2 ([@​dependabot](https://togithub.com/dependabot)\[bot]) - [`0b1d408`](https://togithub.com/CycloneDX/cyclonedx-go/commit/0b1d408e1e008c9972eac2206108511f98fc0738): build(deps): bump actions/setup-go from 3.0.0 to 3.1.0 ([@​dependabot](https://togithub.com/dependabot)\[bot]) - [`47702c4`](https://togithub.com/CycloneDX/cyclonedx-go/commit/47702c484c166133a6f5072e975b4351334c238d): build(deps): bump apache/skywalking-eyes from 0.2.0 to 0.3.0 ([@​dependabot](https://togithub.com/dependabot)\[bot]) - [`5940b17`](https://togithub.com/CycloneDX/cyclonedx-go/commit/5940b17535582a8f9111f5c013dd69c9e07bce53): build(deps): bump golangci/golangci-lint-action from 3.1.0 to 3.2.0 ([@​dependabot](https://togithub.com/dependabot)\[bot]) ### [`v0.5.2`](https://togithub.com/CycloneDX/cyclonedx-go/releases/tag/v0.5.2) [Compare Source](https://togithub.com/CycloneDX/cyclonedx-go/compare/v0.5.1...v0.5.2) #### Changelog ##### Fixes - [`0a1487e`](https://togithub.com/CycloneDX/cyclonedx-go/commit/0a1487ee034a465f34a8b9f8a7198d93c4811c45): fix: edit casing of email ([#​30](https://togithub.com/CycloneDX/cyclonedx-go/issues/30)) ([@​jspeed-meyers](https://togithub.com/jspeed-meyers)) - [`644d3e5`](https://togithub.com/CycloneDX/cyclonedx-go/commit/644d3e5e219bcfea92bfbfce354ae95c3f4fed55): fix: encoding of XML chars in tags ([@​derkoe](https://togithub.com/derkoe)) ##### Building and Packaging - [`dea6490`](https://togithub.com/CycloneDX/cyclonedx-go/commit/dea6490495cfeea64fc85e00fa000d9388d60ab9): build(actions): set permissions and timeouts ([@​nscuro](https://togithub.com/nscuro)) - [`22c6201`](https://togithub.com/CycloneDX/cyclonedx-go/commit/22c6201e3ff21d4db95325cd75551ce717be4b6b): build(actions): update cyclonedx cli to 0.24.0 ([@​nscuro](https://togithub.com/nscuro)) - [`9d0e58e`](https://togithub.com/CycloneDX/cyclonedx-go/commit/9d0e58ed92da13937f91a87ab763bc9f5e303496): build(goreleaser): use native sboms feature ([@​nscuro](https://togithub.com/nscuro)) ### [`v0.5.1`](https://togithub.com/CycloneDX/cyclonedx-go/releases/tag/v0.5.1) [Compare Source](https://togithub.com/CycloneDX/cyclonedx-go/compare/v0.5.0...v0.5.1) #### Changelog ##### Fixes - [`1fd9caf`](https://togithub.com/CycloneDX/cyclonedx-go/commit/1fd9caf52906ff41300f8a13e8d1f28fbdefef6d): fix: make vuln rating score optional ([@​nscuro](https://togithub.com/nscuro)) ##### Building and Packaging - [`1f31d49`](https://togithub.com/CycloneDX/cyclonedx-go/commit/1f31d499debebde7a64746ce989478b76c60b8e3): build(ci): add setup-go to lint job ([@​nscuro](https://togithub.com/nscuro)) - [`018dff2`](https://togithub.com/CycloneDX/cyclonedx-go/commit/018dff2c923dd820dda0a1b9a2b05b7e2dcf7078): build(deps): bump github.com/stretchr/testify from 1.7.0 to 1.7.1 ([@​dependabot](https://togithub.com/dependabot)\[bot]) - [`15708b3`](https://togithub.com/CycloneDX/cyclonedx-go/commit/15708b3ca5da621b37ceddb403c96556b8302ade): build(deps): bump golangci/golangci-lint-action from 2 to 3.1.0 ([@​dependabot](https://togithub.com/dependabot)\[bot]) - [`a2abeb6`](https://togithub.com/CycloneDX/cyclonedx-go/commit/a2abeb69f0173b530208c1728e58c2530305574f): build(deps): update `actions/checkout` to v3.0.0 ([@​nscuro](https://togithub.com/nscuro)) - [`ba3af87`](https://togithub.com/CycloneDX/cyclonedx-go/commit/ba3af87b824294d93c368ff33e35e32e7f230b80): build(deps): update `actions/setup-go` to v3.0.0 ([@​nscuro](https://togithub.com/nscuro)) </details> <details> <summary>google/go-cmp</summary> ### [`v0.5.9`](https://togithub.com/google/go-cmp/releases/tag/v0.5.9) [Compare Source](https://togithub.com/google/go-cmp/compare/v0.5.8...v0.5.9) Reporter changes: - ([#​299](https://togithub.com/google/go-cmp/issues/299)) Adjust heuristic for line-based versus byte-based diffing - ([#​306](https://togithub.com/google/go-cmp/issues/306)) Use `value.TypeString` in `PathStep.String` Code cleanup changes: - ([#​297](https://togithub.com/google/go-cmp/issues/297)) Use `reflect.Value.IsZero` - ([#​304](https://togithub.com/google/go-cmp/issues/304)) Format with Go 1.19 formatter - ([#​300](https://togithub.com/google/go-cmp/issues/300) )Fix typo in Result documentation - ([#​302](https://togithub.com/google/go-cmp/issues/302)) Pre-declare global type variables - ([#​309](https://togithub.com/google/go-cmp/issues/309)) Run tests on Go 1.19 </details> <details> <summary>jedib0t/go-pretty</summary> ### [`v6.3.8`](https://togithub.com/jedib0t/go-pretty/releases/tag/v6.3.8) [Compare Source](https://togithub.com/jedib0t/go-pretty/compare/v6.3.7...v6.3.8) ### Features - **progress** - can now display "speed" of progress for each tracker (thanks [@​iyear](https://togithub.com/iyear)) </details> <details> <summary>spdx/tools-golang</summary> ### [`v0.3.0`](https://togithub.com/spdx/tools-golang/releases/tag/v0.3.0) [Compare Source](https://togithub.com/spdx/tools-golang/compare/v0.2.0...v0.3.0) ##### New Features and Enhancements - Add support for saving SPDX JSON: [#​92](https://togithub.com/spdx/tools-golang/issues/92), [#​94](https://togithub.com/spdx/tools-golang/issues/94), [#​97](https://togithub.com/spdx/tools-golang/issues/97), [#​98](https://togithub.com/spdx/tools-golang/issues/98), [#​104](https://togithub.com/spdx/tools-golang/issues/104), [#​106](https://togithub.com/spdx/tools-golang/issues/106), [#​113](https://togithub.com/spdx/tools-golang/issues/113) - Begin OpenSSF Best Practices process and add initial badge: [#​111](https://togithub.com/spdx/tools-golang/issues/111) - also enabled branch protection for main branch ##### Bug fixes - tvsaver: Fix incorrect tag for Snippet IDs: [#​95](https://togithub.com/spdx/tools-golang/issues/95) - GitHub Actions: Fix incorrect branch for code coverage: [#​112](https://togithub.com/spdx/tools-golang/issues/112) - builder: Fix file paths to be relative rather than absolute: [#​114](https://togithub.com/spdx/tools-golang/issues/114) - builder: Add missing mandatory field LicenseInfoInFile: [#​119](https://togithub.com/spdx/tools-golang/issues/119) ##### Documentation and Cleanup - Fix link to release notes: [#​91](https://togithub.com/spdx/tools-golang/issues/91) - Language fixes for JSON documentation: [#​108](https://togithub.com/spdx/tools-golang/issues/108) - Add badges and links for releases and documentation: [#​109](https://togithub.com/spdx/tools-golang/issues/109) - Update documentation for release: [#​121](https://togithub.com/spdx/tools-golang/issues/121), [#​122](https://togithub.com/spdx/tools-golang/issues/122) - Fixes for examples and sample run commands: [#​123](https://togithub.com/spdx/tools-golang/issues/123), [#​125](https://togithub.com/spdx/tools-golang/issues/125), [#​126](https://togithub.com/spdx/tools-golang/issues/126), [#​127](https://togithub.com/spdx/tools-golang/issues/127) ##### Contributors - [@​CatalinStratu](https://togithub.com/CatalinStratu) - [@​specter25](https://togithub.com/specter25) - [@​swinslow](https://togithub.com/swinslow) </details> <details> <summary>urfave/cli</summary> ### [`v2.16.3`](https://togithub.com/urfave/cli/releases/tag/v2.16.3) [Compare Source](https://togithub.com/urfave/cli/compare/v2.16.2...v2.16.3) #### What's Changed - Move more functionality into internal/build/build.go by [@​meatballhat](https://togithub.com/meatballhat) in [https://github.com/urfave/cli/pull/1490](https://togithub.com/urfave/cli/pull/1490) **Full Changelog**: urfave/cli@v2.16.2...v2.16.3 ### [`v2.16.2`](https://togithub.com/urfave/cli/releases/tag/v2.16.2) [Compare Source](https://togithub.com/urfave/cli/compare/v2.16.1...v2.16.2) #### What's Changed - Fix: Help name consistency among app/commands and subcommands by [@​dearchap](https://togithub.com/dearchap) in [https://github.com/urfave/cli/pull/1489](https://togithub.com/urfave/cli/pull/1489) **Full Changelog**: urfave/cli@v2.16.1...v2.16.2 ### [`v2.16.1`](https://togithub.com/urfave/cli/releases/tag/v2.16.1) [Compare Source](https://togithub.com/urfave/cli/compare/v2.16.0...v2.16.1) #### What's Changed - Set codecov status thresholds to 5% by [@​meatballhat](https://togithub.com/meatballhat) in [https://github.com/urfave/cli/pull/1486](https://togithub.com/urfave/cli/pull/1486) - Fix: dont generate pointer for dest for Generic flag by [@​dearchap](https://togithub.com/dearchap) in [https://github.com/urfave/cli/pull/1488](https://togithub.com/urfave/cli/pull/1488) **Full Changelog**: urfave/cli@v2.16.0...v2.16.1 ### [`v2.16.0`](https://togithub.com/urfave/cli/releases/tag/v2.16.0) [Compare Source](https://togithub.com/urfave/cli/compare/v2.15.0...v2.16.0) #### What's Changed - Feature:(Issue 1334) Add support for uint64slices by [@​dearchap](https://togithub.com/dearchap) in [https://github.com/urfave/cli/pull/1378](https://togithub.com/urfave/cli/pull/1378) **Full Changelog**: urfave/cli@v2.15.0...v2.16.0 ### [`v2.15.0`](https://togithub.com/urfave/cli/releases/tag/v2.15.0) [Compare Source](https://togithub.com/urfave/cli/compare/v2.14.2...v2.15.0) #### What's Changed - Add count option for bool flags by [@​dearchap](https://togithub.com/dearchap) in [https://github.com/urfave/cli/pull/1257](https://togithub.com/urfave/cli/pull/1257) **Full Changelog**: urfave/cli@v2.14.2...v2.15.0 ### [`v2.14.2`](https://togithub.com/urfave/cli/releases/tag/v2.14.2) [Compare Source](https://togithub.com/urfave/cli/compare/v2.14.1...v2.14.2) #### What's Changed - Update version of codecov action by [@​meatballhat](https://togithub.com/meatballhat) in [https://github.com/urfave/cli/pull/1480](https://togithub.com/urfave/cli/pull/1480) - Add a few notes to release docs by [@​meatballhat](https://togithub.com/meatballhat) in [https://github.com/urfave/cli/pull/1479](https://togithub.com/urfave/cli/pull/1479) **Full Changelog**: urfave/cli@v2.14.1...v2.14.2 ### [`v2.14.1`](https://togithub.com/urfave/cli/releases/tag/v2.14.1) [Compare Source](https://togithub.com/urfave/cli/compare/v2.14.0...v2.14.1) #### What's Changed - Fix:(issue\_1272) Generic flag not set from env by [@​dearchap](https://togithub.com/dearchap) in [https://github.com/urfave/cli/pull/1458](https://togithub.com/urfave/cli/pull/1458) - GitHub Workflows security hardening by [@​sashashura](https://togithub.com/sashashura) in [https://github.com/urfave/cli/pull/1469](https://togithub.com/urfave/cli/pull/1469) #### New Contributors - [@​sashashura](https://togithub.com/sashashura) made their first contribution in [https://github.com/urfave/cli/pull/1469](https://togithub.com/urfave/cli/pull/1469) **Full Changelog**: urfave/cli@v2.14.0...v2.14.1 ### [`v2.14.0`](https://togithub.com/urfave/cli/releases/tag/v2.14.0) [Compare Source](https://togithub.com/urfave/cli/compare/v2.13.0...v2.14.0) #### What's Changed - Update v2 dead link by [@​abousselmi](https://togithub.com/abousselmi) in [https://github.com/urfave/cli/pull/1466](https://togithub.com/urfave/cli/pull/1466) - Fix:(issue\_1293) Wrap usage text for commands by [@​dearchap](https://togithub.com/dearchap) in [https://github.com/urfave/cli/pull/1460](https://togithub.com/urfave/cli/pull/1460) - Add App.InvalidFlagAccessHandler by [@​icholy](https://togithub.com/icholy) in [https://github.com/urfave/cli/pull/1446](https://togithub.com/urfave/cli/pull/1446) #### New Contributors - [@​abousselmi](https://togithub.com/abousselmi) made their first contribution in [https://github.com/urfave/cli/pull/1466](https://togithub.com/urfave/cli/pull/1466) - [@​icholy](https://togithub.com/icholy) made their first contribution in [https://github.com/urfave/cli/pull/1446](https://togithub.com/urfave/cli/pull/1446) **Full Changelog**: urfave/cli@v2.13.0...v2.14.0 ### [`v2.13.0`](https://togithub.com/urfave/cli/releases/tag/v2.13.0) [Compare Source](https://togithub.com/urfave/cli/compare/v2.12.3...v2.13.0) #### What's Changed - Fix:(issue\_1094) Dont execute Before/After handlers during shell comp… by [@​dearchap](https://togithub.com/dearchap) in [https://github.com/urfave/cli/pull/1457](https://togithub.com/urfave/cli/pull/1457) - Fix:(issue\_1455) Allow bool flags from input altsrc by [@​dearchap](https://togithub.com/dearchap) in [https://github.com/urfave/cli/pull/1456](https://togithub.com/urfave/cli/pull/1456) - Add configurable Base to int, uint and uint64 flags by [@​ccremer](https://togithub.com/ccremer) in [https://github.com/urfave/cli/pull/1464](https://togithub.com/urfave/cli/pull/1464) - fix: allow required flag with one character by [@​Gerrard-YNWA](https://togithub.com/Gerrard-YNWA) in [https://github.com/urfave/cli/pull/1449](https://togithub.com/urfave/cli/pull/1449) - Add support for alias in YAMLs by [@​james-prysm](https://togithub.com/james-prysm) in [https://github.com/urfave/cli/pull/1448](https://togithub.com/urfave/cli/pull/1448) #### New Contributors - [@​ccremer](https://togithub.com/ccremer) made their first contribution in [https://github.com/urfave/cli/pull/1464](https://togithub.com/urfave/cli/pull/1464) - [@​Gerrard-YNWA](https://togithub.com/Gerrard-YNWA) made their first contribution in [https://github.com/urfave/cli/pull/1449](https://togithub.com/urfave/cli/pull/1449) - [@​james-prysm](https://togithub.com/james-prysm) made their first contribution in [https://github.com/urfave/cli/pull/1448](https://togithub.com/urfave/cli/pull/1448) **Full Changelog**: urfave/cli@v2.12.3...v2.13.0 ### [`v2.12.3`](https://togithub.com/urfave/cli/releases/tag/v2.12.3) [Compare Source](https://togithub.com/urfave/cli/compare/v2.12.2...v2.12.3) #### What's Changed - issue\_62: Make slice options more posix like by [@​dearchap](https://togithub.com/dearchap) in [https://github.com/urfave/cli/pull/1454](https://togithub.com/urfave/cli/pull/1454) - Move genflags tool to cmd/ and pin to previous release by [@​meatballhat](https://togithub.com/meatballhat) in [https://github.com/urfave/cli/pull/1451](https://togithub.com/urfave/cli/pull/1451) - Shift supported go versions by [@​meatballhat](https://togithub.com/meatballhat) in [https://github.com/urfave/cli/pull/1452](https://togithub.com/urfave/cli/pull/1452) - docs: split documentation into individual pages by [@​hay-kot](https://togithub.com/hay-kot) in [https://github.com/urfave/cli/pull/1453](https://togithub.com/urfave/cli/pull/1453) #### New Contributors - [@​hay-kot](https://togithub.com/hay-kot) made their first contribution in [https://github.com/urfave/cli/pull/1453](https://togithub.com/urfave/cli/pull/1453) **Full Changelog**: urfave/cli@v2.12.1...v2.12.3 ### [`v2.12.2`](https://togithub.com/urfave/cli/releases/tag/v2.12.2) [Compare Source](https://togithub.com/urfave/cli/compare/v2.12.1...v2.12.2) #### What's Changed - issue\_62: Make slice options more posix like by [@​dearchap](https://togithub.com/dearchap) in [https://github.com/urfave/cli/pull/1454](https://togithub.com/urfave/cli/pull/1454) - Move genflags tool to cmd/ and pin to previous release by [@​meatballhat](https://togithub.com/meatballhat) in [https://github.com/urfave/cli/pull/1451](https://togithub.com/urfave/cli/pull/1451) - Shift supported go versions by [@​meatballhat](https://togithub.com/meatballhat) in [https://github.com/urfave/cli/pull/1452](https://togithub.com/urfave/cli/pull/1452) - docs: split documentation into individual pages by [@​hay-kot](https://togithub.com/hay-kot) in [https://github.com/urfave/cli/pull/1453](https://togithub.com/urfave/cli/pull/1453) #### New Contributors - [@​hay-kot](https://togithub.com/hay-kot) made their first contribution in [https://github.com/urfave/cli/pull/1453](https://togithub.com/urfave/cli/pull/1453) **Full Changelog**: urfave/cli@v2.12.1...v2.12.2 ### [`v2.12.1`](https://togithub.com/urfave/cli/releases/tag/v2.12.1) [Compare Source](https://togithub.com/urfave/cli/compare/v2.12.0...v2.12.1) **Full Changelog**: urfave/cli@v2.11.5...v2.12.1 ### [`v2.12.0`](https://togithub.com/urfave/cli/releases/tag/v2.12.0) [Compare Source](https://togithub.com/urfave/cli/compare/v2.11.5...v2.12.0) **Full Changelog**: urfave/cli@v2.11.2...v2.12.0 ### [`v2.11.5`](https://togithub.com/urfave/cli/releases/tag/v2.11.5) [Compare Source](https://togithub.com/urfave/cli/compare/v2.11.4...v2.11.5) **Full Changelog**: urfave/cli@v2.11.2...v2.11.5 ### [`v2.11.4`](https://togithub.com/urfave/cli/releases/tag/v2.11.4) [Compare Source](https://togithub.com/urfave/cli/compare/v2.11.3...v2.11.4) **Full Changelog**: urfave/cli@v2.11.2...v2.11.4 ### [`v2.11.3`](https://togithub.com/urfave/cli/releases/tag/v2.11.3) [Compare Source](https://togithub.com/urfave/cli/compare/v2.11.2...v2.11.3) **Full Changelog**: urfave/cli@v2.11.2...v2.11.3 ### [`v2.11.2`](https://togithub.com/urfave/cli/releases/tag/v2.11.2) [Compare Source](https://togithub.com/urfave/cli/compare/v2.11.1...v2.11.2) #### What's Changed - Fix HideHelp by [@​Dokiys](https://togithub.com/Dokiys) in [https://github.com/urfave/cli/pull/1445](https://togithub.com/urfave/cli/pull/1445) - Fix After not run by [@​Dokiys](https://togithub.com/Dokiys) in [https://github.com/urfave/cli/pull/1444](https://togithub.com/urfave/cli/pull/1444) #### New Contributors - [@​Dokiys](https://togithub.com/Dokiys) made their first contribution in [https://github.com/urfave/cli/pull/1445](https://togithub.com/urfave/cli/pull/1445) **Full Changelog**: urfave/cli@v2.11.1...v2.11.2 </details> <details> <summary>golang/go</summary> ### [`v1.19.1`](https://togithub.com/golang/go/compare/go1.19...go1.19.1) ### [`v1.19.0`](https://togithub.com/golang/go/compare/go1.18.6...go1.19) </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 becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- 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/google/osv.dev). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xOTUuNSIsInVwZGF0ZWRJblZlciI6IjMyLjE5NS41In0=--> Co-authored-by: Rex Pan <rexpan@google.com>
What type of PR is this?
What this PR does / why we need it:
This PR add a way of counting number of times a bool flag is set. This is useful when specifying the flag multiple times(-v -v -v etc).
Which issue(s) this PR fixes:
#757
Special notes for your reviewer:
Testing
Add test code in flag_test.go
go test -run=TestBoolFlagApply_SetsCount ./...
Release Notes
Adds ability to count number of occurrences of bool flags