Jaymon / captain

command line python scripts for humans
MIT License
13 stars 1 forks source link

store_false action #74

Closed Jaymon closed 1 year ago

Jaymon commented 1 year ago

basically, passing in:

    @arg(
        "--discard-foo",
        action="store_false",
        help="Pass this flag to discard foo"
    )

Would be equivalent to this:

    @arg(
        "--discard-foo",
        default=True,
        const=False,
        action="store_const",
        help="Pass this flag to discard foo"
    )
Jaymon commented 1 year ago

https://docs.python.org/3/library/argparse.html#action