Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sphinx and argparse - autodocumenting command line scripts?

I'm building a Python package, and using Sphinx to create the docs. Aside from my package code, I also include a lot of command line Python scripts, which use argparse. I was wondering if there is a way to get Sphinx to autodocument these scripts? The end goal would be a pretty-printed list of scripts, with the associated help print, arguments and options. And to be clear, I'm looking for a pre-existing way to do this, not a way to implement this myself.

This isn't as specific of a question as I usually ask on S.O., if there is a more appropriate S.E. site to post this question, let me know.

like image 231
jeremiahbuddha Avatar asked Jun 04 '12 19:06

jeremiahbuddha


1 Answers

Use sphinx-argparse extension:

http://sphinx-argparse.readthedocs.org/en/latest/

like image 164
ribozz Avatar answered Oct 02 '22 12:10

ribozz