Skip to content

Let custom flags use version aliases#2350

Open
ibobgunardi wants to merge 1 commit into
urfave:mainfrom
ibobgunardi:bobi/version-flag-alias-conflict
Open

Let custom flags use version aliases#2350
ibobgunardi wants to merge 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
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