Fix #1 incomplete usage descriptions

This commit is contained in:
jpk 2023-08-18 15:50:33 +02:00
parent 44d6b868d8
commit 6abe651e76
2 changed files with 3 additions and 8 deletions

View File

@ -27,7 +27,7 @@ def iter_commands(
if isinstance(cliobj, click.Group):
if depth > 1:
yield f"{'#'*depth} {cliobj.name}"
yield f"{'#'*depth} {tool_name} {cliobj.name}"
for name in sorted(cliobj.commands):
yield from iter_commands(
@ -38,12 +38,7 @@ def iter_commands(
cmd = f"{tool_name} {' '.join(cmd_chain)}"
help_message = cliobj.get_help(ctx).replace(ctx.command_path, cmd)
if cliobj.name == "cli":
cmd_title = "Default Command Line"
else:
cmd_title = cliobj.name
yield f"{'#'*(depth)} {tool_name} {cmd_title}\n```\n{help_message}\n```"
yield f"{'#'*(depth)} {tool_name} {' '.join(cmd_chain)}\n```\n{help_message}\n```"
def generate_usage_md(script: str, version: str):

View File

@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "clickusagemd"
version = "0.8.5"
version = "0.8.6"
description = ""
authors = ["Jules <jules@deutschebahn.com>"]
packages = [