Lucretiel / autocommand

Autocommand turns a python function into a CLI program
GNU Lesser General Public License v3.0
52 stars 9 forks source link

Add smarter no inverting #16

Open Lucretiel opened 7 years ago

Lucretiel commented 7 years ago

Sometimes, when a default behavior is for a boolean switch to be True, the user will type in this:

@autocommand(__name__)
def main(no_do_thing=False):
    pass

Instead of this:

@autocommand(__name__)
def main(do_thing=True):
    pass

This is because the user doesn't want --do_thing to mean do_thing=False. This issue proposes that, when addnos is given, then boolean switches will retain the default, but that the `no` versions will ALWAYS make them false, and the presence of the standard flag will ALWAYS make them True.

This is, unfortunately, a breaking change.