Say we have a task
@task
def store_configs(_, host='consul', port=8500, conf_yml='consuled_conf.yml'):
c = Consul(host, port)
conf = yaml.load(open(conf_yml))
for k, v in conf['configs'].items():
c.kv[conf['prefix'] + '/' + k] = v
if I run invoke store_configs, the following error shows up:
No idea what 'store_configs' is!
in order to invoke it I must do following:
invoke store-configs
Which isn't obvious. I think there are two option:
BTW, it used to work in prevous versions
The behavior was intentionally changed (I think in 0.20.0). Can't comment on reasoning. Anyway, if you want to restore the original behavior, there is auto_dash_names flag that you can disable. For example in ~/.invoke.yaml:
tasks:
auto_dash_names: false
Be sure to use 0.20.2+ for there was a bug regarding this option (https://github.com/pyinvoke/invoke/issues/465).
Most helpful comment
The behavior was intentionally changed (I think in 0.20.0). Can't comment on reasoning. Anyway, if you want to restore the original behavior, there is
auto_dash_namesflag that you can disable. For example in~/.invoke.yaml:Be sure to use 0.20.2+ for there was a bug regarding this option (https://github.com/pyinvoke/invoke/issues/465).