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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sphinx_argparse_cli-1.4.0.tar.gz.
File metadata
- Download URL: sphinx_argparse_cli-1.4.0.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
341891a47290509c0b90f4357059781fc0aa03ec9e1f24ab76e9ba1b4bf155d7
|
|
| MD5 |
2d32e84a10bd8982ce53b35bd500cb98
|
|
| BLAKE2b-256 |
773e4f67161eb4152b0fa518e7bd909c70626b1b0124a040905b7776e2356eba
|
File details
Details for the file sphinx_argparse_cli-1.4.0-py3-none-any.whl.
File metadata
- Download URL: sphinx_argparse_cli-1.4.0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fe2f7f432c9bb39831dcef313f721261b97b426bcf6403edb2aefab6435f4a6
|
|
| MD5 |
aef2a00559964d6c02196259f0d58441
|
|
| BLAKE2b-256 |
1d8ff1e98d0052e03acb46c80c4374c7d1288deedf9c6379c7b8288351a0ff3a
|