Skip to content

Commit d26c6a4

Browse files
author
Hamza
committed
Lazy-load CLI commands so Usage: augur [OPTIONS] COMMAND [ARGS]...
Augur is an application for open source community health analytics Options: --help Show this message and exit. Commands: api Commands for controlling the backend API server backend Commands for controlling the backend API server & data collection workers cache Commands for managing redis cache collection Commands for controlling the backend API server & data collection workers config Generate an augur.config.json csv_utils db Database utilities github Github utilities jumpstart tasks Commands for controlling the backend API server & data collection workers user Support for adding regular users or administrative users works without DB config Signed-off-by: Hamza <mezohafez1@gmail.com>
1 parent cfd638b commit d26c6a4

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

augur/application/cli/_multicommand.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
#SPDX-License-Identifier: MIT
1+
# SPDX-License-Identifier: MIT
22
"""
33
Runs Augur with Gunicorn when called
44
"""
5-
5+
import sys
66
import os
77
import click
88
import importlib
9-
import traceback
109

1110
from pathlib import Path
1211
# import augur.application
@@ -31,15 +30,21 @@ def get_command(self, ctx, name):
3130
# Check that the command exists before importing
3231
if not cmdfile.is_file():
3332
return
34-
33+
# Top-level help: do not import any command modules
34+
if "-h" in sys.argv or "--help" in sys.argv:
35+
return click.Command(name=name)
3536
# Prefer to raise exception instead of silcencing it
36-
module = importlib.import_module('.' + name, 'augur.application.cli')
37+
module = importlib.import_module("." + name, "augur.application.cli")
3738
return module.cli
3839

3940
@click.command(cls=AugurMultiCommand, context_settings=CONTEXT_SETTINGS)
4041
@click.pass_context
4142
def run(ctx):
4243
"""
43-
Augur is an application for open source community health analytics
44+
Augur is an application for open source community health analytics.
45+
46+
Note: When no database configuration is detected, the top-level help
47+
output is intentionally limited and does not include per-command
48+
summaries. See issue #3654 for details.
4449
"""
4550
return ctx

0 commit comments

Comments
 (0)