Click: [Bug]Why I can't use argument when use Nesting Commands

Created on 14 Feb 2017  Â·  1Comment  Â·  Source: pallets/click

@click.group()
def cli():
    pass


@cli.command()
@cli.argument('table_name', help="spider Table name you want to stat")
def btc_stat(table_name):
    class Stat(BaseBtcStat):
        table_name = table_name

    stat = Stat()
    stat.run()


cli()
(.env) ➜  fibo_statistics git:(feature/wyx) ✗ python run_stat.py -h    
Traceback (most recent call last):
  File "run_stat.py", line 24, in <module>
    @cli.argument('table_name', help="spider Table name you want to stat")
AttributeError: 'Group' object has no attribute 'argument'

Most helpful comment

Try @click.argument(...)

>All comments

Try @click.argument(...)

Was this page helpful?
0 / 5 - 0 ratings