Skip to content

Let custom flags use version aliases#2350

Merged
dearchap merged 1 commit into
urfave:mainfrom
ibobgunardi:bobi/version-flag-alias-conflict
Jun 11, 2026
Merged

Let custom flags use version aliases#2350
dearchap merged 1 commit into
urfave:mainfrom
ibobgunardi:bobi/version-flag-alias-conflict

Conversation

@ibobgunardi

Copy link
Copy Markdown

Fixes #2229.

When a root command defines its own flag using the default version names, setup now leaves the custom flag in control instead of appending the built-in version flag and treating that value as a version request.

Tested with:

  • go test . -run TestCommand_Run_(Version|CustomFlagCanUseVersionAlias)$ -count=1 -v
  • go test . -run Test(Command_Run|_Version_Custom_Flags|CustomHelpVersionFlags|Command_CanAddVFlagOnSubCommands) -count=1
  • go test . -count=1
  • git diff --check

@ibobgunardi ibobgunardi requested a review from a team as a code owner June 5, 2026 08:24
@dearchap dearchap merged commit 6c8cf24 into urfave:main Jun 11, 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.

--verbose flag gets interpreted as "print version and exit"

2 participants