Added --json to dump command
This commit is contained in:
@@ -123,12 +123,19 @@ def info(cli_obj):
|
|||||||
|
|
||||||
|
|
||||||
@cli.command()
|
@cli.command()
|
||||||
|
@click.option(
|
||||||
|
"--json",
|
||||||
|
required=False,
|
||||||
|
is_flag=True,
|
||||||
|
default=False,
|
||||||
|
help="Print output in JSON format.",
|
||||||
|
)
|
||||||
@click.pass_obj
|
@click.pass_obj
|
||||||
def dump(cli_obj):
|
def dump(cli_obj, json):
|
||||||
""" Print list of all photos & associated info from the Photos library. """
|
""" Print list of all photos & associated info from the Photos library. """
|
||||||
pdb = osxphotos.PhotosDB(dbfile=cli_obj.db)
|
pdb = osxphotos.PhotosDB(dbfile=cli_obj.db)
|
||||||
photos = pdb.photos()
|
photos = pdb.photos()
|
||||||
print_photo_info(photos, cli_obj.json)
|
print_photo_info(photos, cli_obj.json or json)
|
||||||
|
|
||||||
|
|
||||||
@cli.command(name="list")
|
@cli.command(name="list")
|
||||||
|
|||||||
Reference in New Issue
Block a user