Support options with type=bool.

Review Request #3623 - Created March 29, 2016 and submitted

Information
Benjy Weinberger
pants
3626
Reviewers
pants-reviews
kwlzn, mateor, stuhood, zundel

This will ultimately replace action='store_{true|false}'.

In this new implementation, boolean flags work like any other type.
In particular, you can pass an explicit boolean-valued literal:
--foo=true, --bar=False etc.

Support for boolean flags with no value (--foo --no-bar etc.) is now
implemented via the existing implicit_value mechanism. As you may recall,
implicit_value is a registration arg, available on any option type, that
provides a value to be used if the flag is specified with no value.
This allows us to have less special-casing of boolean flags.

All existing old-style boolean options have been munged into
new style ones, so they are effectively implemented via this
new implementation. Therefore deprecating them in the near future
should be straightforward.

CI passes: https://travis-ci.org/pantsbuild/pants/builds/119118470

Benjy Weinberger
Stu Hood
Mateo Rodriguez
Benjy Weinberger
Review request changed

Status: Closed (submitted)

Change Summary:

319d55448cf4f3bd86fc56987a495f2e2858dc62

Benjy Weinberger

Submitted as 319d55448cf4f3bd86fc56987a495f2e2858dc62. Thanks Stu and Mateo.

Loading...