ocrd workspace find: searching by ID
@@ -130,6 +130,7 @@ def workspace_add_file(ctx, file_grp, file_id, mimetype, url, group_id, local_fi
@click.option('-G', '--file-grp', help="fileGrp USE")
@click.option('-m', '--mimetype', help="Media type to look for")
@click.option('-g', '--group-id', help="GROUPID")
+@click.option('-i', '--file-id', help="ID")
@click.option('-k', '--output-field', help="Output field", default='url', type=click.Choice([
'url',
'mimetype',
@@ -141,9 +142,10 @@ def workspace_add_file(ctx, file_grp, file_id, mimetype, url, group_id, local_fi
]))
@click.option('--download', is_flag=True, help="Download found files")
@pass_workspace
-def workspace_find(ctx, file_grp, mimetype, group_id, output_field, download):
+def workspace_find(ctx, file_grp, mimetype, group_id, file_id, output_field, download):
workspace = Workspace(ctx.resolver, directory=ctx.directory)
for f in workspace.mets.find_files(
+ ID=file_id,
fileGrp=file_grp,
mimetype=mimetype,
groupId=group_id,
