Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DEFINE_enum_class to docs #472

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions docs/python/guides/flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ flags have other arguments, which are described with the flag.
* `DEFINE_enum`: takes a list of strings that represents legal values. If the
command-line value is not in this list, it raises a flag error; otherwise,
it assigns to `FLAGS.flag` as a string.
* `DEFINE_enum_class`: takes a subclass of `enum.Enum` that represents legal
values. If the command-line value is not in this enum (ignoring the case),
it raises a flag value error; otherwise, it assigns to `FLAGS.flag`
as an Enum.
* `DEFINE_list`: Takes a comma-separated list of strings on the command line
and stores them in a Python list object.
* `DEFINE_spaceseplist`: Takes a space-separated list of strings on the
Expand All @@ -86,6 +90,10 @@ flags have other arguments, which are described with the flag.
* `DEFINE_multi_enum`: The same as `DEFINE_enum`, except the flag can be
specified more than once on the command line. The result is a Python list
object (list of strings), even if the flag is only on the command line once.
* `DEFINE_multi_enum`: The same as `DEFINE_enum_class`, except the flag can be
specified more than once on the command line. The result is a Python list
object (list of `Enum`s), even if the flag is only on the command line once.
* `DEFINE_alias`: Defines an alias flag for an existing one.

## Special Flags

Expand Down