- parser = argparse.ArgumentParser()
- parser.add_argument(
- 'INFILE', help='README.md file name to read from')
- parser.add_argument(
- 'OUTFILE', help='CONTRIBUTING.md file name to write to')
- args = parser.parse_args()
-
- with io.open(args.INFILE, encoding='utf-8') as inf:
+ return # This is unused in yt-dlp
+
+ parser = optparse.OptionParser(usage='%prog INFILE OUTFILE')
+ options, args = parser.parse_args()
+ if len(args) != 2:
+ parser.error('Expected an input and an output filename')
+
+ infile, outfile = args
+
+ with open(infile, encoding='utf-8') as inf: