Skip to content
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

fix: duplicate usage output #786

Merged
merged 1 commit into from
Jun 20, 2024
Merged

fix: duplicate usage output #786

merged 1 commit into from
Jun 20, 2024

Conversation

phm07
Copy link
Contributor

@phm07 phm07 commented Jun 20, 2024

When a *pflag.FlagSet is parsed, it outputs a usage string if the --help flag is included. Since Cobra already does this, this behavior needs to be disabled or the usage will be printed twice.


Since #736 hasn't been release yet, this fix shouldn't appear in the changelog.

BEGIN_COMMIT_OVERRIDE
chore: fix duplicate usage output
END_COMMIT_OVERRIDE

When a *pflag.FlagSet is parsed, it outputs a usage string if the --help flag is included. Since Cobra already does this, this behavior needs to be disabled or the usage will be printed twice.
@phm07 phm07 added the bug label Jun 20, 2024
@phm07 phm07 self-assigned this Jun 20, 2024
@phm07 phm07 requested a review from a team as a code owner June 20, 2024 09:21
Copy link

codecov bot commented Jun 20, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 59.68%. Comparing base (f69d261) to head (7b63f38).
Report is 1 commits behind head on main.

Files Patch % Lines
internal/state/config/config.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #786      +/-   ##
==========================================
- Coverage   59.74%   59.68%   -0.07%     
==========================================
  Files         209      210       +1     
  Lines        7634     7639       +5     
==========================================
- Hits         4561     4559       -2     
- Misses       2432     2437       +5     
- Partials      641      643       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@phm07 phm07 merged commit b4df982 into main Jun 20, 2024
5 checks passed
@phm07 phm07 deleted the fix-usage-output branch June 20, 2024 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants