mosquito / argclass

A wrapper around the standard argparse module that allows you to describe argument parsers declaratively
Apache License 2.0
12 stars 3 forks source link

Error with optional arguments without type #7

Closed dizballanze closed 2 years ago

dizballanze commented 2 years ago

When I'm trying something like this:

dsn: Optional[URL] = argclass.Argument(required=False)

I'm getting error like this:

error: argument --dsn: invalid Optional value: 'https://example.org/'

It works with type, though:

dsn: Optional[URL] = argclass.Argument(required=False, type=URL)