From 2a5f0a22995f541e566a4bfe9082648b481af763 Mon Sep 17 00:00:00 2001 From: Rhet Turnbull Date: Sun, 22 Dec 2019 08:15:21 -0800 Subject: [PATCH] Added --json to dump command --- osxphotos/__main__.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/osxphotos/__main__.py b/osxphotos/__main__.py index 04654c3a..cdc7bcd4 100644 --- a/osxphotos/__main__.py +++ b/osxphotos/__main__.py @@ -123,12 +123,19 @@ def info(cli_obj): @cli.command() +@click.option( + "--json", + required=False, + is_flag=True, + default=False, + help="Print output in JSON format.", +) @click.pass_obj -def dump(cli_obj): +def dump(cli_obj, json): """ Print list of all photos & associated info from the Photos library. """ pdb = osxphotos.PhotosDB(dbfile=cli_obj.db) photos = pdb.photos() - print_photo_info(photos, cli_obj.json) + print_photo_info(photos, cli_obj.json or json) @cli.command(name="list")