Skip to content

feat: add LegacyBoolHelp to restore pre-v1.0.6 bool help formatting#480

Open
leno23 wants to merge 1 commit into
spf13:masterfrom
leno23:fix/legacy-bool-help-454
Open

feat: add LegacyBoolHelp to restore pre-v1.0.6 bool help formatting#480
leno23 wants to merge 1 commit into
spf13:masterfrom
leno23:fix/legacy-bool-help-454

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 26, 2026

Summary

Fixes #454

Since #410, bool flags include [=true|false] and (default true/false) in help output. Some projects relied on the previous compact formatting for 80-column layouts.

This adds FlagSet.LegacyBoolHelp. When enabled, bool and boolfunc flags omit the syntax hint and default value in help text while keeping current behavior as the default.

Test plan

  • Added TestLegacyBoolHelp and TestLegacyBoolHelpBoolFunc
  • go test ./...

Made with Cursor

Bool flags now show [=true|false] and default values in help output since
spf13#410. Add FlagSet.LegacyBoolHelp so existing projects can opt out without
regex workarounds when upgrading.

Fixes spf13#454.

Co-authored-by: Cursor <cursoragent@cursor.com>
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


wuyangfan seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

Disable new help display of bool values?

2 participants