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 name of the function that once called with no arguments constructs the parser |
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.2.tar.gz
(16.1 kB
view hashes)
Built Distribution
Close
Hashes for sphinx_argparse_cli-1.5.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fef0e5eae95aa5a5a1e23de889a2b37c9d1c3eb835e13c67228e01b33f003ca |
|
MD5 | 40085c9c6e02fe4e18b41824337e233c |
|
BLAKE2b-256 | 983b3d266ee382e25c002609381d78fd83b3ffdf7689b3aefde229a8ddfbffbb |
Close
Hashes for sphinx_argparse_cli-1.5.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e644b8ddf82894b34b8703e24ff04c90a60135006a0d8b33fef292c5385bbee |
|
MD5 | 1a9c10d9ffe8262d97474952cda8e708 |
|
BLAKE2b-256 | 8cf090de8751003cc6e4a686949c3e928badde846d5d452db2e2684cd8572598 |