Skip to content

Commit

Permalink
commands.help:cmd_help - fix incorrect variable initialisation
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoCampinoti94 committed Nov 15, 2024
1 parent 9383291 commit 706abbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion digiarch/commands/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def commands_completion(ctx: Context, param: Option, incomplete: str) -> list[Co
def cmd_help(ctx: Context, commands: tuple[str, ...]):
"""Show the help for a command."""
app = ctx.find_root().command
cmds = [c for c in commands if not c.startswith("-")]

try:
cmds = [c for c in commands if not c.startswith("-")]
cmd = reduce(lambda a, c: a.commands[c] if isinstance(a, Group) else a, cmds, app)
print(cmd.get_help(app.make_context(cmd.name, cmds, ctx.parent)))
except (KeyError, AttributeError):
Expand Down

0 comments on commit 706abbb

Please sign in to comment.