Skip to content

Show range values for IntRange option --help #1525

@grantka

Description

@grantka

Expected Behavior

Similar to the show_defaults=True parameter, options that have type IntRange should print the expected range values in the help text

@click.option('-c', '--count', required=True, type=click.IntRange(1, 100, show_range=True))
def set_count(count)
   pass
>>> mycli set-count --help
Usage: mycli set-count [OPTIONS]

  Set the target count

Options:
  -c, --count INTEGER RANGE  [1-100 inclusive, required]

Actual Behavior

   -c, --count INTEGER RANGE  [required]

Environment

  • Python version: 3.7.3
  • Click version: 7.0

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