Skip to content

fix: let --help flag take precedence over parse errors#2360

Merged
dearchap merged 4 commits into
urfave:mainfrom
dearchap:issue_2126
Jun 14, 2026
Merged

fix: let --help flag take precedence over parse errors#2360
dearchap merged 4 commits into
urfave:mainfrom
dearchap:issue_2126

Conversation

@dearchap

@dearchap dearchap commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • bug

What this PR does / why we need it:

Fixes two help invocation inconsistencies related to issue #2126.

  1. --help flag now takes precedence over parse errors: When --help is given alongside a bad flag (e.g. app --help --undefined), the help output is now shown instead of printing "Incorrect Usage".

  2. Updated stale comments in helpCommandAction to list all actual invocation paths.

Which issue(s) this PR fixes:

Related to #2126

Release Notes

`--help` flag works when given alongside invalid flags

@dearchap dearchap requested a review from a team as a code owner June 8, 2026 01:49

@meatballhat meatballhat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the addition of the opencode config in this change is intentional, I'd like to understand why 😁

Comment thread opencode.json Outdated
dearchap added 4 commits June 13, 2026 21:44
When --help is explicitly provided alongside bad flags, the help output
should be shown instead of printing 'Incorrect Usage'. Also update stale
comments in helpCommandAction to reflect all actual invocation paths.
@dearchap dearchap merged commit 2c38e7b into urfave:main Jun 14, 2026
9 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.

2 participants