diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -53,6 +53,8 @@ entry_points=''' [console_scripts] swh-indexer=swh.indexer.cli:main + [swh.cli.subcommands] + indexer=swh.indexer.cli:cli ''', classifiers=[ "Programming Language :: Python :: 3", diff --git a/swh/indexer/cli.py b/swh/indexer/cli.py --- a/swh/indexer/cli.py +++ b/swh/indexer/cli.py @@ -6,6 +6,7 @@ import click from swh.core import config +from swh.core.cli import CONTEXT_SETTINGS from swh.scheduler import get_scheduler from swh.scheduler.cli_utils import schedule_origin_batches from swh.storage import get_storage @@ -15,10 +16,7 @@ from swh.indexer.storage.api.server import load_and_check_config, app -CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help']) - - -@click.group(context_settings=CONTEXT_SETTINGS) +@click.group(name='indexer', context_settings=CONTEXT_SETTINGS) @click.option('--config-file', '-C', default=None, type=click.Path(exists=True, dir_okay=False,), help="Configuration file.")