Skip to content

not able to define help text for commands using rats.cli.command() #491

@ms-lolo

Description

@ms-lolo

this function is supposed to wrap click.command() to allow it to be used on class methods, typically implementations of rats.cli.Container. there was a first basic implementation that took the method's docstring and used it as the click command short help value, but it seems to not be working any more. it would also be nice if we could add the ability to specify any of the original click.command() arguments, probably by accepting a simple **kwargs and forwarding it along.

@cli.command()
def foo(self) -> None:
    """
    This is the short description of the command, shown on parent command listings.

    This is part of the larger description, shown on this command's --help text. This
    docstring is a valid python apidoc docstring as parsed by our documentation tooling,
    and should be usable as a decent default for generating a command's `--help` text.
    """
    print("hello, world")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions