Fixed CLI help for invalid topic, closes #76

This commit is contained in:
Rhet Turnbull
2020-04-05 08:25:30 -07:00
parent bae0283441
commit 6073acc9d3
2 changed files with 42 additions and 1 deletions

View File

@@ -1149,9 +1149,12 @@ def help(ctx, topic, **kw):
""" Print help; for help on commands: help <command>. """
if topic is None:
click.echo(ctx.parent.get_help())
else:
elif topic in cli.commands:
ctx.info_name = topic
click.echo_via_pager(cli.commands[topic].get_help(ctx))
else:
click.echo(f"Invalid command: {topic}", err=True)
click.echo(ctx.parent.get_help())
def print_photo_info(photos, json=False):