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.4.0.tar.gz
(15.9 kB
view hashes)
Built Distribution
Close
Hashes for sphinx_argparse_cli-1.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 341891a47290509c0b90f4357059781fc0aa03ec9e1f24ab76e9ba1b4bf155d7 |
|
MD5 | 2d32e84a10bd8982ce53b35bd500cb98 |
|
BLAKE2b-256 | 773e4f67161eb4152b0fa518e7bd909c70626b1b0124a040905b7776e2356eba |
Close
Hashes for sphinx_argparse_cli-1.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fe2f7f432c9bb39831dcef313f721261b97b426bcf6403edb2aefab6435f4a6 |
|
MD5 | aef2a00559964d6c02196259f0d58441 |
|
BLAKE2b-256 | 1d8ff1e98d0052e03acb46c80c4374c7d1288deedf9c6379c7b8288351a0ff3a |