diff --git a/invenio_utilities_tuw/cli/files.py b/invenio_utilities_tuw/cli/files.py index e6f8b99ab08c6285e32a7620b569425221173a72..258d5f6b9765bef4e25fb3f9e69a197c0ddcb6fe 100644 --- a/invenio_utilities_tuw/cli/files.py +++ b/invenio_utilities_tuw/cli/files.py @@ -73,7 +73,7 @@ def deleted(): @option_pid_type @with_appcontext def list_deleted_files(pid, pid_type): - """Hard-delete files that have already been soft-deleted. + """List files that have already been soft-deleted. Optionally, this operation can be restricted to the bucket associated with a draft (via its PID). @@ -103,7 +103,7 @@ def list_deleted_files(pid, pid_type): db.session.commit() -@deleted.command("rm") +@deleted.command("clean") @click.confirmation_option( prompt="are you sure you want to permanently remove soft-deleted files?" ) @@ -150,13 +150,17 @@ def hard_delete_files(pid, pid_type): @files.group("orphans") def orphans(): - """Management commands for orphaned files.""" + """Management commands for unreferenced files. + + Orphaned files are those that are still present in the storage, but are not + referenced by any Location's buckets anymore. + """ @orphans.command("list") @with_appcontext def list_orphan_files(): - """List files from locations that aren't referenced in any DB models anymore.""" + """List existing files that aren't referenced in Invenio anymore.""" for loc in Location.query.all(): # we only know how to handle directories on the file system for now if os.path.isdir(loc.uri): @@ -177,7 +181,7 @@ def list_orphan_files(): ) @with_appcontext def clean_files(): - """List files from locations that aren't referenced in any DB models anymore.""" + """Delete existing files that aren't referenced in Invenio anymore.""" for loc in Location.query.all(): # we only know how to handle directories on the file system for now if not os.path.isdir(loc.uri):