From 2d3344ee34f21dee2fbc19223977bc39f3ff005e Mon Sep 17 00:00:00 2001 From: Rhet Turnbull Date: Fri, 9 Apr 2021 06:37:51 -0700 Subject: [PATCH] Updated docs for --query-eval --- README.md | 18 ++++++++++-------- osxphotos/cli.py | 3 ++- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a2abfd8e..4e4e9283 100644 --- a/README.md +++ b/README.md @@ -317,14 +317,16 @@ Options: --not-in-album Search for photos that are not in any albums. --query-eval CRITERIA Evaluate CRITERIA to filter photos. CRITERIA will be evaluated in context of the following - list comprehension: `photos = [photo for photo - in photos if CRITERIA]` where photo represents - a PhotoInfo object. For example: `--query-eval - photo.favorite` returns all photos that have - been favorited and is equivalent to - --favorite. You may specify more than one - CRITERIA by using --query-eval multiple times. - See https://rhettbull.github.io/osxphotos/ for + python list comprehension: `photos = [photo + for photo in photos if CRITERIA]` where photo + represents a PhotoInfo object. For example: + `--query-eval photo.favorite` returns all + photos that have been favorited and is + equivalent to --favorite. You may specify more + than one CRITERIA by using --query-eval + multiple times. CRITERIA must be a valid + python expression. See + https://rhettbull.github.io/osxphotos/ for additional documentation on the PhotoInfo class. diff --git a/osxphotos/cli.py b/osxphotos/cli.py index e4c44277..d88dcec9 100644 --- a/osxphotos/cli.py +++ b/osxphotos/cli.py @@ -452,12 +452,13 @@ def query_options(f): metavar="CRITERIA", multiple=True, help="Evaluate CRITERIA to filter photos. " - "CRITERIA will be evaluated in context of the following list comprehension: " + "CRITERIA will be evaluated in context of the following python list comprehension: " "`photos = [photo for photo in photos if CRITERIA]` " "where photo represents a PhotoInfo object. " "For example: `--query-eval photo.favorite` returns all photos that have been " "favorited and is equivalent to --favorite. " "You may specify more than one CRITERIA by using --query-eval multiple times. " + "CRITERIA must be a valid python expression. " "See https://rhettbull.github.io/osxphotos/ for additional documentation on the PhotoInfo class.", ), ]