Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
Make enum parsing case insensitive (#31)
Browse files Browse the repository at this point in the history
* Make enum parsing case insensitive

* version
  • Loading branch information
mpcusack-color authored Aug 16, 2021
1 parent 8f5279b commit 6873a40
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions clr/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,8 @@ def _get_arg_type(param):

def enum_parser(arg):
arg = arg.upper()
assert (
arg in param.annotation.__members__
), f"Arg ({param.name}={arg}) must be one of {tuple(param.annotation.__members__.keys())}."
options = set(key.upper() for key in param.annotation.__members__)
assert arg in options, f"Arg ({param.name}={arg}) must be one of {options}."
return param.annotation.__members__[arg]

return enum_parser
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name="clr",
version="0.3.13",
version="0.3.14",
description="A command line tool for executing custom python scripts.",
author="Color",
author_email="dev@getcolor.com",
Expand Down

0 comments on commit 6873a40

Please sign in to comment.