Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions docs/parameter-types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Example:
import enum

class HashType(enum.Enum):
MD5 = 'MD5'
SHA1 = 'SHA1'
MD5 = enum.auto()
SHA1 = enum.auto()

@click.command()
@click.option('--hash-type',
Expand All @@ -54,9 +54,8 @@ What it looks like:
println()
invoke(digest, args=['--help'])

Since version 8.2.0 any iterable may be passed to :class:`Choice`, here
an ``Enum`` is used which will result in all enum values to be valid
choices.
Any iterable may be passed to :class:`Choice`. If an ``Enum`` is passed, the
names of the enum members will be used as valid choices.

Choices work with options that have ``multiple=True``. If a ``default``
value is given with ``multiple=True``, it should be a list or tuple of
Expand Down