from enum import Enum


def Choices(choices):
    """Multipe-choice options for typer.

    This is a convenicence function that creates string Enums to be
    used as the type of command-line arguments that can take a fixed set
    of values. For example, the command::

        @app.command()
        def main(arg: Choices('value1 value2')):
            pass

    takes one argument that may either have the value `value1` or the
    value `value2`.
    """

    class StringEnum(str, Enum):
        pass

    return StringEnum('Choices', ((o, o) for o in choices.split(' ')))