3 ms·
http://docopt.org/ http://docopt.org/ — turns help text in a Python doc string into an argument parser. After a doc string put: import docopt args = d
by imurray 7y ago
http://docopt.org/ http://docopt.org/ — turns help text in a Python doc string into an argument parser.
After a doc string put:
import docopt
args = docopt.docopt(__doc__, version='0.0.1')
Edit: krapht points out there is now support for multiple languages: https://github.com/docopt https://github.com/docopt
- krapht 7y agoI use Docopt now for every CLI script I write, using Docopt language ports. Skipping argument parsing boilerplate is so nice, not to mention now I don't have to remember how each different language is supposed to idiomatically parse CLI arguments.