Skip to content

add help to click argument #587

@borismod

Description

@borismod

I would like to be able to specify help on positional arguments.

@click.group()
def cli():
    click.echo(u'shellfoundry - CloudShell shell command-line tool')
    pass

@cli.command()
@click.argument(u'name', help='Shell name to be created')
@click.argument(u'template', default=u'default', help='Template to be used')
def new(name, template):
    """
    Create a new shell based on a template.\r\n
    """
    NewCommandExecutor().new(name, template)

The above code throws the below exception:

Traceback (most recent call last):
File "C:\Python27\lib\runpy.py", line 162, in run_module_as_main
"main", fname, loader, pkg_name)
File "C:\Python27\lib\runpy.py", line 72, in run_code
exec code in run_globals
File "c:\work\GitHub\shellfoundry\shellfoundry__main
.py", line 6, in
from bootstrap import cli
File "shellfoundry\bootstrap.py", line 36, in
@click.argument(u'template', default=u'default', help='Template to be used')
File "C:\Python27\lib\site-packages\click\decorators.py", line 151, in decorator
_param_memo(f, ArgumentClass(param_decls, **attrs))
File "C:\Python27\lib\site-packages\click\core.py", line 1693, in init
Parameter.init(self, param_decls, required=required, **attrs)
TypeError: init() got an unexpected keyword argument 'help'

Metadata

Metadata

Assignees

No one assigned

    Labels

    f:helpfeature: help textf:parametersfeature: input parameter types

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions