From 6c21fc83d3d6173bffb60e686ec579f875f8bebe Mon Sep 17 00:00:00 2001 From: Nejc Habjan Date: Sun, 11 Oct 2020 13:38:31 +0200 Subject: docs(cli): add auto-generated CLI reference --- gitlab/cli.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'gitlab/cli.py') diff --git a/gitlab/cli.py b/gitlab/cli.py index d356d16..ff98a4f 100644 --- a/gitlab/cli.py +++ b/gitlab/cli.py @@ -149,6 +149,20 @@ def _parse_value(v): return v +def docs(): + """ + Provide a statically generated parser for sphinx only, so we don't need + to provide dummy gitlab config for readthedocs. + """ + if "sphinx" not in sys.modules: + sys.exit("Docs parser is only intended for build_sphinx") + + parser = _get_base_parser(add_help=False) + cli_module = importlib.import_module("gitlab.v4.cli") + + return _get_parser(cli_module) + + def main(): if "--version" in sys.argv: print(gitlab.__version__) -- cgit v1.2.1