diff options
author | Max Wittig <max.wittig@siemens.com> | 2020-10-12 17:24:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-12 17:24:22 +0200 |
commit | 9054a3be492091f3a323914ee24b682f993c9fcb (patch) | |
tree | a34a487bbfde0ca16614c1d7772ae4aa34b82ef4 /gitlab/cli.py | |
parent | 8cb8040198a6183c7c4bd3745af800fcf303fe43 (diff) | |
parent | 6c21fc83d3d6173bffb60e686ec579f875f8bebe (diff) | |
download | gitlab-9054a3be492091f3a323914ee24b682f993c9fcb.tar.gz |
Merge pull request #1209 from python-gitlab/docs/cli-reference-page
docs(cli): add auto-generated CLI reference
Diffstat (limited to 'gitlab/cli.py')
-rw-r--r-- | gitlab/cli.py | 14 |
1 files changed, 14 insertions, 0 deletions
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__) |