Skip to content

option with bool type #1287

@Cologler

Description

@Cologler
@click.command()
@click.option('--shout/--no-shout', default=False)
def info(shout):
    pass

info()

is ok, but

@click.command()
@click.option('--shout/--no-shout', default=False, type=bool)
def info(shout):
    pass

info()

will raise a TypeError: Got secondary option for non boolean flag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions