add '--exec-after'

This commit is contained in:
Mike Fährmann
2019-11-27 19:42:46 +01:00
parent ed6592ea1a
commit bca2222559

View File

@@ -306,13 +306,6 @@ def build_parser():
action="append_const", const={"name": "zip"},
help="Store downloaded files in a ZIP archive",
)
postprocessor.add_argument(
"--exec",
dest="postprocessors", metavar="CMD",
action=AppendCommandAction, const={"name": "exec"},
help=("Execute CMD for each downloaded file. "
"Example: --exec 'magick convert {} {}.png && rm {}'"),
)
postprocessor.add_argument(
"--ugoira-conv",
dest="postprocessors", action="append_const", const={
@@ -352,6 +345,20 @@ def build_parser():
action="append_const", const={"name": "mtime"},
help="Set file modification times according to 'date' metadata",
)
postprocessor.add_argument(
"--exec",
dest="postprocessors", metavar="CMD",
action=AppendCommandAction, const={"name": "exec"},
help=("Execute CMD for each downloaded file. "
"Example: --exec 'convert {} {}.png && rm {}'"),
)
postprocessor.add_argument(
"--exec-after",
dest="postprocessors", metavar="CMD",
action=AppendCommandAction, const={"name": "exec", "final": True},
help=("Execute CMD after all files were downloaded successfully. "
"Example: --exec-after 'cd {} && convert * ../doc.pdf'"),
)
parser.add_argument(
"urls",