main() got multiple values for keyword argument
oscarbenjamin opened this issue · comments
Oscar Benjamin commented
With current master and a script like
# foo.py
from __future__ import print_function
import opster
@opster.command()
def main(arg1,
opt=('o', False, 'use option'),
*args):
print(arg1)
print(args)
if __name__ == "__main__":
main.command()
I get the following if I try to call main
directly:
>>> import foo
>>> foo.main('a', 'b', 'c')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "opster.py", line 202, in inner
return call_cmd_regular(func, options_)(*args, **opts)
File "opster.py", line 890, in inner
return func(*args, **funckwargs)
TypeError: main() got multiple values for keyword argument 'opt'
Is that a bug? I thought Opster would take care of this but when I actually added it to the doctests in the docs branch it didn't work.