I have a command as:
import click
@click.command()
@click.option('--count', default=1)
def test(count):
click.echo('Count: %d' % count)
How can I call this test(...)
as normal Python function?
I tried to call the function as test("123")
, but received exception:
Error: Got unexpected extra arguments (1 2 3)
So, assuming that the test(...)
function comes with a third-party package and I can't modify anything in the function, how can I call this test(...)
function?