added help to query

This commit is contained in:
Rhet Turnbull 2019-08-18 19:13:35 -07:00
parent 0d51798384
commit 93cc305fa7

View File

@ -123,10 +123,13 @@ def dump(cli_obj):
@click.pass_context @click.pass_context
def query(ctx, cli_obj, keyword, person, album, uuid, json): def query(ctx, cli_obj, keyword, person, album, uuid, json):
""" query the Photos database using 1 or more search options """ """ query the Photos database using 1 or more search options """
photos = cli_obj.photosdb.photos( if not keyword and not person and not album and not uuid:
keywords=keyword, persons=person, albums=album, uuid=uuid print(cli.commands['query'].get_help(ctx))
) else:
print_photo_info(photos, cli_obj.json or json) photos = cli_obj.photosdb.photos(
keywords=keyword, persons=person, albums=album, uuid=uuid
)
print_photo_info(photos, cli_obj.json or json)
@cli.command() @cli.command()