[options] Accept quoted string across multiple lines (#9940)
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Wed, 29 Jun 2016 12:56:05 +0000 (14:56 +0200)
committerSergey M․ <dstftw@gmail.com>
Thu, 30 Jun 2016 20:30:31 +0000 (03:30 +0700)
Like:

    -f "
    bestvideo+bestaudio/
    best
    "

youtube_dl/options.py

index 99ce4131fdfaacbbbca07805fbc86c8563ea95fe..c9033e3cb230e4019b49c0fa6903ce1e8c65d556 100644 (file)
@@ -26,9 +26,7 @@ def parseOpts(overrideArguments=None):
         except IOError:
             return default  # silently skip if file is not present
         try:
-            res = []
-            for l in optionf:
-                res += compat_shlex_split(l, comments=True)
+            res = compat_shlex_split(optionf.read(), comments=True)
         finally:
             optionf.close()
         return res