Skip to content

feat: suggest matching flags on parse errors - #2483

Open
Boulea7 wants to merge 1 commit into
spf13:mainfrom
Boulea7:issue-2207-flag-suggestions
Open

feat: suggest matching flags on parse errors#2483
Boulea7 wants to merge 1 commit into
spf13:mainfrom
Boulea7:issue-2207-flag-suggestions

Conversation

@Boulea7

@Boulea7 Boulea7 commented Aug 11, 2026

Copy link
Copy Markdown

Summary

  • suggest nearby long flags when pflag reports an unknown flag
  • include local and persistent flags, including with TraverseChildren
  • preserve custom FlagErrorFunc behavior and exclude hidden flags and shorthand errors

Fixes #2207

Testing

  • go test ./...
  • go test -race ./...
  • make all
  • make lint

@Boulea7
Boulea7 marked this pull request as ready for review August 11, 2026 13:01
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.

Suggestions when "unknown flag" happens

1 participant