Subtle bug in parameter handling

The parameter names must not be converted to upper case before calling
context.invoke, because that works with the lowercase names.

Before this bugfix,, we had kw like this in the various setup_* functions:
{'DB_URI': 'sqlite:////tmp/wiki.db', 'db_uri': 'sqlite:////real/path.db'}
and whichever won was pretty much random (dict sort order)
This commit is contained in:
Lars Immisch 2015-09-24 21:49:18 +02:00
父節點 9d340e0da1
當前提交 644929c4c8
共有 1 個文件被更改,包括 1 次插入1 次删除

查看文件

@ -61,7 +61,7 @@ def prompt_and_invoke(ctx, fn):
for p in fn.params:
v = click.prompt(p.prompt, p.default, p.hide_input,
p.confirmation_prompt, p.type)
kw[p.name.upper()] = v
kw[p.name] = v
ctx.invoke(fn, **kw)