Allow variadic CliPositionalArg
to accept an empty list, or have a default value
#524
Labels
CliPositionalArg
to accept an empty list, or have a default value
#524
Thank you so much for implementing #519!
However, i've pulled down the changes for testing, and did notice that there doesn't seem to be a way to have a command accept an arbitrary number of positional arguments that can be empty.
Output when running as
python example.py
:So, to work around this I've tried using both
values: CliPositionalArg[list[str]] = []
andvalues: CliPositionalArg[list[str] | None] = None
instead, but both result inpydantic_settings.sources.SettingsError: positional argument Main.values has a default value
.My use case is similar to a command like
docker compose up
, where when no positional arguments are passed there's different behavior.The text was updated successfully, but these errors were encountered: