Skip to content

Invoke OnUsageError when missing required flags #2161

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

Merged
merged 4 commits into from
Jul 13, 2025

Conversation

MohitPanchariya
Copy link
Contributor

What type of PR is this?

  • bug

What this PR does / why we need it:

This PR aims to fix the issue noted in #2145

  • command_run.go - func (cmd *Command) run has been modified to run the
    OnUsageError function when the checkAllRequiredFlags check fails.

Which issue(s) this PR fixes:

Fixed #2145

In case of missing required flags, the OnUsageError function
will now be invoked instead of directly returning the error.
@MohitPanchariya MohitPanchariya marked this pull request as ready for review June 20, 2025 07:07
@MohitPanchariya MohitPanchariya requested a review from a team as a code owner June 20, 2025 07:07
@MohitPanchariya
Copy link
Contributor Author

Hi @Juneezee , can you help me with merging this?

@Juneezee Juneezee enabled auto-merge July 11, 2025 14:53
@Juneezee Juneezee disabled auto-merge July 11, 2025 14:53
@Juneezee Juneezee enabled auto-merge July 11, 2025 14:53
@Juneezee
Copy link
Member

@dearchap There seem to be some problems with the CodeQL checks that are preventing the auto-merge. Could you take a quick look when you are available?

@dearchap dearchap disabled auto-merge July 13, 2025 21:00
@dearchap dearchap merged commit c185573 into urfave:main Jul 13, 2025
7 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.

Missing required flags does not trigger ExitErrHandler
3 participants