pydantic-argparse
pydantic-argparse copied to clipboard
Metavar support
Hi great project! I was wondering if it is possible to implement something similar to the argparse
packages metavar
argument. I strongly prefer my arguments to specify what type should be input, and I would think this is doable since the pydantic
backend is already keeping track of types.
Envision something like this:
from pydantic import BaseModel, Field, FilePath
class Args
intarg: int = Field(..., description="an integer")
file: FilePath = Field(..., description="a file")
then at cli:
./example_program.py --help
--intarg INT: an integer
--file FilePath: a file