diff --git a/src/codemodder/cli.py b/src/codemodder/cli.py index efc89fbb..a48fa7de 100644 --- a/src/codemodder/cli.py +++ b/src/codemodder/cli.py @@ -139,7 +139,7 @@ def parse_args(argv, codemod_registry): "--log-format", type=OutputFormat, default=OutputFormat.HUMAN, - choices=[str(x).split(".")[-1].lower() for x in list(OutputFormat)], + choices=[OutputFormat.HUMAN, OutputFormat.JSON], help="the format for the log output", ) parser.add_argument( diff --git a/src/codemodder/logging.py b/src/codemodder/logging.py index 7a050d0d..5590b9dd 100644 --- a/src/codemodder/logging.py +++ b/src/codemodder/logging.py @@ -13,6 +13,10 @@ class OutputFormat(Enum): HUMAN = "human" JSON = "json" + def __str__(self): + """For rendering properly in argparse help.""" + return self.value.lower() + def log_section(section_name: str): """