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, python-build 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.1.tar.gz
(15.9 kB
view hashes)
Built Distribution
Close
Hashes for sphinx_argparse_cli-1.5.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c6f12209af8854cefadbc5e8b8488a2b7d8ec8e352092712cfb2b7c9afd5102 |
|
MD5 | aed0749cff6bce741ab79b6de4b08abc |
|
BLAKE2b-256 | ee9916f9922999614d383d9990a53c30d35bccf60687b3c3eb11cb425cd33d26 |
Close
Hashes for sphinx_argparse_cli-1.5.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3ac3f68ffa2a18aff0b60cb6a3d286a4d19b1ecb89d55a2d8f8957039ebdc78 |
|
MD5 | 417c84dc4bdd58205425dd6b50af4fdc |
|
BLAKE2b-256 | 0840ee2689eab022a72e5b717209497b5d1b4fcf1ea1ac00ee347e7fbebf008d |