Updated docs for --query-eval

This commit is contained in:
Rhet Turnbull
2021-04-09 06:37:51 -07:00
parent b4bc906b6a
commit 2d3344ee34
2 changed files with 12 additions and 9 deletions

View File

@@ -317,14 +317,16 @@ Options:
--not-in-album Search for photos that are not in any albums. --not-in-album Search for photos that are not in any albums.
--query-eval CRITERIA Evaluate CRITERIA to filter photos. CRITERIA --query-eval CRITERIA Evaluate CRITERIA to filter photos. CRITERIA
will be evaluated in context of the following will be evaluated in context of the following
list comprehension: `photos = [photo for photo python list comprehension: `photos = [photo
in photos if CRITERIA]` where photo represents for photo in photos if CRITERIA]` where photo
a PhotoInfo object. For example: `--query-eval represents a PhotoInfo object. For example:
photo.favorite` returns all photos that have `--query-eval photo.favorite` returns all
been favorited and is equivalent to photos that have been favorited and is
--favorite. You may specify more than one equivalent to --favorite. You may specify more
CRITERIA by using --query-eval multiple times. than one CRITERIA by using --query-eval
See https://rhettbull.github.io/osxphotos/ for multiple times. CRITERIA must be a valid
python expression. See
https://rhettbull.github.io/osxphotos/ for
additional documentation on the PhotoInfo additional documentation on the PhotoInfo
class. class.

View File

@@ -452,12 +452,13 @@ def query_options(f):
metavar="CRITERIA", metavar="CRITERIA",
multiple=True, multiple=True,
help="Evaluate CRITERIA to filter photos. " 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]` " "`photos = [photo for photo in photos if CRITERIA]` "
"where photo represents a PhotoInfo object. " "where photo represents a PhotoInfo object. "
"For example: `--query-eval photo.favorite` returns all photos that have been " "For example: `--query-eval photo.favorite` returns all photos that have been "
"favorited and is equivalent to --favorite. " "favorited and is equivalent to --favorite. "
"You may specify more than one CRITERIA by using --query-eval multiple times. " "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.", "See https://rhettbull.github.io/osxphotos/ for additional documentation on the PhotoInfo class.",
), ),
] ]