First check
Description
With argparse it it possible to do something like:
parser.add_argument(
"--host",
type=IPv4Address,
default=IPv4Address("127.0.0.1"),
)
This will automatically try to construct a IPv4Address type from the input and validate that it is a valid IPv4Address.
$ main.py --host=a
...
main.py: error: argument --host: invalid IPv4Address value: 'a'
I didn't see this type documented in typer. Is this possible to do?
First check
Description
With
argparseit it possible to do something like:This will automatically try to construct a
IPv4Addresstype from the input and validate that it is a validIPv4Address.I didn't see this type documented in
typer. Is this possible to do?