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.3.0.tar.gz
(15.8 kB
view hashes)
Built Distribution
Close
Hashes for sphinx_argparse_cli-1.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83657df78c87fd77f430a05fab42e1b8ce24f62df1e51ecdf2146b1793ed312c |
|
MD5 | 06c9e10185d40b1c3d022c239bfa5b8d |
|
BLAKE2b-256 | 5a35577f31162c3049674d3b084e6abfddeb3d1c6b7ba6f6a8c48f33effdccbc |
Close
Hashes for sphinx_argparse_cli-1.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e56fe509fb71d0eef80a60d6fb2110fb8b5e77ab5bac69e89f0a90b2dc017da5 |
|
MD5 | 98a2d1eadd57e02df896fef8f535d77a |
|
BLAKE2b-256 | eb7a9bd85f4f509eb5c6ac71b22b7df4caaea4aa17f9e7ecad2166a7094e39b3 |