diff --git a/pydantic_cli/examples/simple_with_custom.py b/pydantic_cli/examples/simple_with_custom.py index 65308f6..7fdfcc6 100644 --- a/pydantic_cli/examples/simple_with_custom.py +++ b/pydantic_cli/examples/simple_with_custom.py @@ -1,6 +1,6 @@ import sys import logging -from typing import Union +from typing import Union, Literal from pydantic import Field @@ -17,6 +17,7 @@ class Options(Cmd): max_records: int = Field(10, cli=("-m", "--max-records")) min_filter_score: float = Field(..., cli=("-f", "--filter-score")) alpha: Union[int, str] = 1 + beta: Literal["a", "b"] = "a" def run(self) -> None: log.info( diff --git a/pydantic_cli/tests/test_examples_simple_with_custom.py b/pydantic_cli/tests/test_examples_simple_with_custom.py index e5fd091..a347026 100644 --- a/pydantic_cli/tests/test_examples_simple_with_custom.py +++ b/pydantic_cli/tests/test_examples_simple_with_custom.py @@ -10,4 +10,4 @@ def test_simple_01(self): self.run_config(["-i", "/path/to/file.txt", "-f", "1.0", "-m", "2"]) def test_simple_02(self): - self.run_config(["-i", "/path/to/file.txt", "-f", "1.0"]) + self.run_config(["-i", "/path/to/file.txt", "-f", "1.0", "--beta", "b"])