rg3/youtube-dl — pull request #1575 by SavinaRoja (2013-10-07 20:27:59+00:00)
Title: Implementing Youtube-dl's commandline argument parsing with Docopt

I have revised youtube-dl to rely on a local copy of [docopt](https://github.com/docopt/docopt) rather than the standard module optparse. This greatly simplifies the code for youtube-dl's option interface; you simply need to modify the docstring for youtube-dl (the "help" message) to introduce/remove/alter options and arguments.

The following files are changed:
youtube_dl/__init__.py : Addition of docstring, general substitution of optparse with docopt
youtube_dl/docopt.py : Local copy of docopt
youtube_dl/utils.py : docopt compatibility in make_HTTPS_handler

Usage changes:
URL(s) should come before all options. The --sub-langs option accepts multiple arguments, rather than a single comma-separated argument. The deprecated option --literal was dropped, though it can be added back if desired. Alternative long-form option names were dropped from some of the subtitle options, these can also be added back there is a need.

All of the options should be tested before distribution to ensure that I did not break anything in the conversion. Such bugs might be introduced by the use of incorrect types, though I tried to preserve them.