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:(issue_1930) Fix for invalid bool counts #1941

Merged
merged 3 commits into from
Jul 1, 2024

Conversation

dearchap
Copy link
Contributor

What type of PR is this?

(REQUIRED)

  • bug
  • cleanup

What this PR does / why we need it:

(REQUIRED)

Which issue(s) this PR fixes:

(REQUIRED)

Fixes #1930
Fixes #1929

Special notes for your reviewer:

(fill-in or delete this section)

Testing

(fill-in or delete this section)

go test -run=TestCommand_Value
go test -run=TestBoolFlagCountFromCommand

Release Notes

(REQUIRED)

The normalizeFlags function is redundant and causes the value.Set to be triggered for every alias which in turn increments count for flag unnecessarily. This function is a holdover from very very old code and has been removed. This fixes the count issue and also allows multiple aliases of same flag to be used without any errors. 

@dearchap dearchap requested a review from a team as a code owner June 30, 2024 14:43
fiatjaf added a commit to fiatjaf/cli that referenced this pull request Jun 30, 2024
@Skeeve
Copy link
Contributor

Skeeve commented Jul 1, 2024

Are there any plans as to when alpha10 will be released?

command_test.go Outdated Show resolved Hide resolved
@dearchap dearchap requested a review from Juneezee July 1, 2024 11:58
@dearchap dearchap merged commit 5b3eb1c into urfave:main Jul 1, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug in v3: Count is off by 1 What is the purpose of normalizeFlags?
3 participants