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

adjust tests for HideDefault #1937

Merged
merged 11 commits into from
Jun 29, 2024
Merged

Conversation

Skeeve
Copy link
Contributor

@Skeeve Skeeve commented Jun 28, 2024

What type of PR is this?

  • feature

What this PR does / why we need it:

It gives the option to hide default values from help output.

It also suppresses the (default: false) from the standard --version and --help as those make absolutely no sense.

Which issue(s) this PR fixes:

#1925

Testing

I changed all standard tests to account for the new help output.

Release Notes

Default values for the automatic help texts of --help and --version will be suppressed.

It's also possible to suppress output of a flag's default value by setting the flag's HideDefault to true.


@Skeeve Skeeve requested a review from a team as a code owner June 28, 2024 17:42
flag.go Outdated Show resolved Hide resolved
flag.go Outdated Show resolved Hide resolved
@dearchap
Copy link
Contributor

@Skeeve Can you fix the conflicts with your PR and main and also run "make v3approve" in your workspace ?

@Skeeve
Copy link
Contributor Author

Skeeve commented Jun 29, 2024

Can you fix the conflicts with your PR and main

~~Is it the "diffcheck" you mean?~~~

You meant the PR you applied yesterday which conflichts with what I did.

I ran v3approve here and this is what I got:

I have no name!@708b2feadea9:/cli$ make v3approve
go run internal/build/build.go  v3approve 
# ---> /usr/bin/git rev-parse --show-toplevel
# ---> /usr/bin/cp -v godoc-current.txt testdata/godoc-v3.x.txt
'godoc-current.txt' -> 'testdata/godoc-v3.x.txt'
I have no name!@708b2feadea9:/cli$ 

What's the purpose of "v3approve"?

@Skeeve
Copy link
Contributor Author

Skeeve commented Jun 29, 2024

I have no idea how to fix the make diffcheck.

@dearchap
Copy link
Contributor

@Skeeve after running make v3approve you have to commit the 2 generated files. I did that for you

@Skeeve
Copy link
Contributor Author

Skeeve commented Jun 29, 2024

@Skeeve after running make v3approve you have to commit the 2 generated files. I did that for you

Thanks, but on my side, nothing was generated :( At least I should have seen something with git status, right?

@dearchap dearchap merged commit ab4b592 into urfave:main Jun 29, 2024
13 checks passed
@Skeeve Skeeve deleted the HideDefaultFlagValue branch June 29, 2024 23:15
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.

2 participants