Skip to main content

render CLI arguments (sub-commands friendly) defined by argparse module

Project description

sphinx-argparse-cli

PyPI PyPI - Implementation PyPI - Python Version PyPI - Downloads PyPI - License check codecov Code style: black

Render CLI arguments (sub-commands friendly) defined by the argparse module.

Demo projects:

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:

  • the module path to where the parser is defined,
  • a no argument function within that module that once called returns the constructed argparse parser
  • (optional) a program name that overwrites the autodiscovered running argument parser
  • (optional) a :title: argument which, when provided, overwrites the <prog> - CLI interface title added by default and when empty, will not be included
.. sphinx_argparse_cli::
  :module: a_project.cli
  :func: build_parser
  :prog: my-cli-program

Project details


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.2.0.tar.gz (14.1 kB view hashes)

Uploaded Source

Built Distribution

sphinx_argparse_cli-1.2.0-py3-none-any.whl (6.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page