render CLI arguments (sub-commands friendly) defined by argparse module
Project description
sphinx-argparse-cli
Render CLI arguments (sub-commands friendly) defined by the argparse module. For live demo checkout the documentation of tox and mdpo.
installation
python -m pip install sphinx-argparse-cli
enable in your conf.py
# just add it to your list of extensions to load within conf.py
extensions = ["sphinx_argparse_cli"]
use
Within the reStructuredText files use the sphinx_argparse_cli
directive that takes, at least, two arguments:
Name | Description |
---|---|
module | the module path to where the parser is defined |
func | the module path to where the parser is defined |
prog | (optional) the module path to where the parser is defined |
title | (optional) when provided, overwrites the <prog> - CLI interface title added by default and when empty, will not be included |
usage_width | (optional) how large should usage examples be - defaults to 100 character |
For example:
.. sphinx_argparse_cli::
:module: a_project.cli
:func: build_parser
:prog: my-cli-program
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sphinx_argparse_cli-1.5.0.tar.gz
(15.9 kB
view hashes)
Built Distribution
Close
Hashes for sphinx_argparse_cli-1.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8c7ff50d7aff546e54217ad5f8c253e073e3e48bc0a687c78034534d3908df0 |
|
MD5 | 8530ea71463cc0bcfb42c92157a3d750 |
|
BLAKE2b-256 | 3a52c7543ef244d7f46d2f59a3f1bd0c31ebc5f03f4af60f33b3f67154f2f259 |
Close
Hashes for sphinx_argparse_cli-1.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12328094d7476d7b2684de77e173a6277c87beeb77359c670087506b88727def |
|
MD5 | 6b3d8ba6b995d52787728189be9f64da |
|
BLAKE2b-256 | 54b3399d2eac12989b9292800633434835c00b7d062631155f538cf041615345 |