Skip to content

Flag aliases don't work with allowNo #1242

@daymxn

Description

@daymxn

Describe the bug
The allowNo option on BooleanFlag doesn't match against aliases.

To Reproduce
Create a BooleanFlag with an alias and allowNo enabled.

gitTag: Flags.boolean({
  aliases: ["git-tag"],
  allowNo: true,
  description: "Create a git tag when publishing the package.",
}),

Try to invoke the command with the no prefix and one of the aliases:

mycli publish --no-git-tag

And you'll get the nonexistent flag error:

Nonexistent flag: --no-git-tag
See more help with --help

Expected behavior
Flag aliases should be usable with the no prefix.

Environment (please complete the following information):

  • OS & version: Windows 10
  • Shell/terminal & version: Windows Terminal w/ powershell

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions