diff --git a/swh/storage/cli.py b/swh/storage/cli.py --- a/swh/storage/cli.py +++ b/swh/storage/cli.py @@ -13,6 +13,7 @@ from swh.core.cli import CONTEXT_SETTINGS from swh.core.cli import swh as swh_cli_group +from swh.storage.replay import object_converter_fn try: from systemd.daemon import notify @@ -159,8 +160,17 @@ type=int, help="Stop after processing this many objects. Default is to " "run forever.", ) +@click.option( + "--type", + "-t", + "object_types", + default=[], + type=click.Choice(list(object_converter_fn)), + help="Object types to check", + multiple=True, +) @click.pass_context -def replay(ctx, stop_after_objects): +def replay(ctx, stop_after_objects, object_types): """Fill a Storage by reading a Journal. There can be several 'replayers' filling a Storage as long as they use @@ -178,6 +188,8 @@ storage = get_storage(**conf.pop("storage")) client_cfg = conf.pop("journal_client") + if object_types: + client_cfg["object_types"] = object_types if stop_after_objects: client_cfg["stop_after_objects"] = stop_after_objects try: