import click
@click.command()
@click.option('--foo', help='the foo arg')
@click.option('--bar', help='the bar arg')
def main(**kwargs):
"""docstirng of main
"""
return kwargs
if __name__ == "__main__":
main()
1command.callback
from a import main
main.callback(foo=111, bar=222)
# {'foo': 111, 'bar': 222}
2 standalone_mode=False
from a import main
main(['--foo', 111, '--bar', 222], standalone_mode=False)
# {'foo': '111', 'bar': '222'}