* CLI argument fixing
@@ -103,16 +103,17 @@ def workspace_create(ctx, mets_url, download_all):
@click.option('-G', '--file-grp', help="fileGrp USE", required=True)
@click.option('-i', '--file-id', help="ID for the file", required=True)
@click.option('-m', '--mimetype', help="Media type of the file", required=True)
+@click.option('-u', '--url', help="url", default="file://local_filename")
@click.option('-g', '--group-id', help="GROUPID")
@click.argument('local_filename', type=click.Path(dir_okay=False, readable=True, resolve_path=True))
@pass_workspace
-def workspace_add_file(ctx, file_grp, file_id, mimetype, group_id, local_filename):
+def workspace_add_file(ctx, file_grp, file_id, mimetype, url, group_id, local_filename):
workspace = Workspace(ctx.resolver, directory=ctx.directory)
workspace.mets.add_file(
- file_grp=file_grp,
- file_id=file_id,
+ fileGrp=file_grp,
+ ID=file_id,
mimetype=mimetype,
- group_id=group_id,
+ url="file://" + local_filename,
local_filename=local_filename
)
workspace.save_mets()
