Releases: swansonk14/typed-argument-parser
Releases · swansonk14/typed-argument-parser
Literals, explicit bools, dashes
Three main changes:
- Added support for
Literal
types, which automatically specify thechoices
for an argument based on the specifiedLiteral
values (ex.arg: Literal['abc', 123]
is equivalent toparser.add_argument('--arg', choices=['abc', 123]
) - Created an option called
explicit_bool
that requires boolean arguments to be specified as--arg True
or--arg False
(or any prefix ofTrue
orFalse
, case insensitive) rather than--arg
. - Created an option called
underscores_to_dashes
which replaces the underscores in variables names with dashes when specified on the command line (ex.arg_1
in theTap
object becomes--arg-1
on the command line)
Fixes
Two bug fixes:
- Git url extraction now works for GitHub Enterprise urls
- Since
inspect.getsource
sometimes throws exceptions (e.g. when inside a Python shell), added atry/except
to allow Tap to work even in these scenarios
Improved help strings
The primary change is that help strings are now parsed from single line comments on the same line as class variable definitions.
Additionally, Tap now supports Optional
and Set
by default.
v_1.1
Removing comment