Page MenuHomeSoftware Heritage

D854.diff
No OneTemporary

D854.diff

diff --git a/swh/scheduler/cli.py b/swh/scheduler/cli.py
--- a/swh/scheduler/cli.py
+++ b/swh/scheduler/cli.py
@@ -68,6 +68,15 @@
return ''.join(lines)
+def list_task_types(ctx, param, value):
+ if not value or ctx.resilient_parsing:
+ return
+ click.echo("Known task types:")
+ for tasktype in ctx.obj.get_task_types():
+ click.echo('{type}:\n {description}'.format(**tasktype))
+ ctx.exit()
+
+
@click.group(context_settings=CONTEXT_SETTINGS)
@click.option('--cls', '-c', default='local',
help="Scheduler's class, default to 'local'")
@@ -102,6 +111,8 @@
@cli.group('task')
+@click.option('--list-types', '-l', is_flag=True, default=False, is_eager=True,
+ expose_value=False, callback=list_task_types)
@click.pass_context
def task(ctx):
"""Manipulate tasks."""

File Metadata

Mime Type
text/plain
Expires
Nov 5 2024, 5:44 PM (11 w, 15 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3225029

Event Timeline