Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7066663
D854.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
843 B
Subscribers
None
D854.diff
View Options
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
Details
Attached
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
Attached To
D854: Several swwh-scheduler's cli improvements
Event Timeline
Log In to Comment