ocrd workspace validate tasks: allow passing --overwrite and --page-id
@@ -100,14 +100,16 @@ def validate_page(page, **kwargs):
# _inform_of_result(WorkspaceValidator.validate(Resolver(), mets_url, **kwargs))
@validate_cli.command('tasks')
-@click.option('--workspace', nargs=1, required=False, help='Workspace these tasks are to be run. If omitted, only validate syntax')
+@click.option('--workspace', nargs=1, required=False, help='Workspace directory these tasks are to be run. If omitted, only validate syntax')
+@click.option('--overwrite', is_flag=True, default=False, help='When checking against a concrete workspace, simulate overwriting output or page range.')
+@click.option('-g', '--page-id', help="ID(s) of the pages to process")
@click.argument('tasks', nargs=-1, required=True)
-def validate_process(tasks, workspace):
+def validate_process(tasks, workspace, overwrite, page_id):
'''
Validate a sequence of tasks passable to 'ocrd process'
'''
if workspace:
- _inform_of_result(validate_tasks([ProcessorTask.parse(t) for t in tasks], Workspace(Resolver(), directory=workspace)))
+ _inform_of_result(validate_tasks([ProcessorTask.parse(t) for t in tasks], Workspace(Resolver(), directory=workspace), page_id=page_id, overwrite=overwrite))
else:
for t in [ProcessorTask.parse(t) for t in tasks]:
_inform_of_result(t.validate())
