pydoit / doit

CLI task management & automation tool
http://pydoit.org
MIT License
1.85k stars 175 forks source link

param keeps false when default value is False and enable inverse #418

Closed bingozhu0197 closed 2 years ago

bingozhu0197 commented 2 years ago

PLEASE DO NOT USE ISSUE TRACKER TO ASK QUESTIONS: see contributing

Describe the bug

def task_with_flag(): def _task(flag): print("Flag {0}".format("On" if flag else "Off"))

return {
    'params': [{
        'name': 'flag',
        'long': 'flagon',
        'short': 'f',
        'type': bool,
        'default': False,
        'inverse': 'flagoff'}],
    'actions': [(_task, )],
    'verbosity': 2
    }

$ doit with_flag --flagoff . with_flag Flag Off

Environment

  1. OS: x86_64 GNU/Linux
  2. python version: Python 3.8.8
  3. doit version: 0.33.1
schettino72 commented 2 years ago

Looks like the expected output to me.