Escape command arguments on dry option

This allows the output to be passed to eval in a script (or something
similar).
This commit is contained in:
Hannes Braun 2023-05-22 21:40:39 +02:00
parent d9304cd392
commit 656cc637bd
1 changed files with 3 additions and 2 deletions

View File

@ -1,12 +1,13 @@
import argparse
import os
import pathlib
import shlex
import subprocess
import yaml
# Hannes' AV1 wrapper script
# Version 2.0.0
# Version 2.0.1
# This is a good guide for optimizing AV1 parameters with the AOM reference encoder:
# https://www.reddit.com/r/AV1/comments/t59j32/encoder_tuning_part_4_a_2nd_generation_guide_to/
@ -101,7 +102,7 @@ cmd += ["-b:a", preset["ba"], "-af", f"aformat=channel_layouts={preset['alayout'
cmd += [args.output]
if args.dry:
print(" ".join(cmd))
print(" ".join(list(map(lambda x:shlex.quote(x), cmd))))
exit(0)
p = subprocess.run(cmd)