diff --git a/osxphotos/__main__.py b/osxphotos/__main__.py index e15775fd..e0081581 100644 --- a/osxphotos/__main__.py +++ b/osxphotos/__main__.py @@ -208,7 +208,11 @@ class ExportCommand(click.Command): + "has no value, '_' (underscore) will be used as the default value. For example, in the " + "above example, this would result in '2020/_/photoname.jpg' if address was null." ) - + formatter.write("\n") + formatter.write_text( + 'You may specify a null default (e.g. "" or empty string) by omitting the value after ' + + 'the comma, e.g. {title,} which would render to "" if title had no value.' + ) formatter.write("\n") templ_tuples = [("Substitution", "Description")] templ_tuples.extend((k, v) for k, v in TEMPLATE_SUBSTITUTIONS.items()) diff --git a/osxphotos/phototemplate.py b/osxphotos/phototemplate.py index f1db5112..104d0d0d 100644 --- a/osxphotos/phototemplate.py +++ b/osxphotos/phototemplate.py @@ -174,9 +174,9 @@ class PhotoTemplate: # there would be 6 possible renderings (2 albums x 3 persons) # regex to find {template_field,optional_default} in strings - # for explanation of regex see https://regex101.com/r/4JJg42/1 + # for explanation of regex see https://regex101.com/r/MbOlJV/4 # pylint: disable=anomalous-backslash-in-string - regex = r"(?