Closed Julian closed 5 months ago
🤔 I'll look into this. Thanks for raising it!
In the meanwhile, I believe if you do this, it should work:
@click.rich_config(
help_config=click.RichHelpConfiguration(command_groups=COMMAND_GROUPS),
)
@click.group("foo", context_settings=dict(help_option_names=["--help", "-h"]))
def main():
pass
^ Here, I added foo
as the name of the group.
Fixed this for 1.8.3
, which I just released. I used the minimally reproducible example you provided (thank you for that!!! ❤️) and confirmed the change works, both for python -m foo
and python3 -m foo
.
Thanks for opening the issue!
Given a basic package called
foo
, with:foo/_cli.py
foo/__main__.py
pyproject.toml
i.e. a
__main__.py
forpython -m foo
, the results ofpython -m foo --help
does not contain the command groups, even thoughfoo --help
will:In "native" click, the
prog_name
option exists in a few places to explicitly say what the program name is -- in my personal experience I always set this, as otherwise it's simply incorrect when the program is used viapython -m
. Perhaps something like that is needed here as well in order to tellrich-click
that when I sayfoo
inCOMMAND_GROUPS
that we still are talking about the same program?Not sure if there's another obvious solution here. Thanks again!