The pydantic Field already provides the means to extend with additional arguments.
This can be exploited to provide optional names, help and so on. However, names and positions of such arguments are not optimal.
Evolve this:
class Config(BaseModel):
foo: str = Field(..., description="A foo", names=("--bar", "-f"))
into this:
class Config(BaseModel):
foo: str = ArgField("--bar", "-f", default=None, description="A foo")
It's not much, but it follows argparse style a little more.
The pydantic Field already provides the means to extend with additional arguments. This can be exploited to provide optional names, help and so on. However, names and positions of such arguments are not optimal. Evolve this:
into this:
It's not much, but it follows
argparse
style a little more.