I'm using click to write a cli program in Python, and I need to write something like this:
import click
@click.group()
def root():
"""root"""
pass
@root.group()
def cli():
"""test"""
pass
@root.group()
def cli2():
"""test"""
pass
@cli.command('test1')
@cli2.command('test1')
def test1():
"""test2"""
print 1234
return
root()
but this will fail with:
TypeError: Attempted to convert a callback into a command twice.
How can I share the command between multiple groups?