diff --git a/bfabric/scripts/bfabric_delete.py b/bfabric/scripts/bfabric_delete.py index 3826f8a..aa7e1df 100755 --- a/bfabric/scripts/bfabric_delete.py +++ b/bfabric/scripts/bfabric_delete.py @@ -16,7 +16,7 @@ from bfabric import Bfabric -def bfabric_delete(client: Bfabric, endpoint: str, id: int) -> None: +def bfabric_delete(client: Bfabric, endpoint: str, id: list[int]) -> None: """Deletes the object with id `id` from the `endpoint`.""" res = client.delete(endpoint=endpoint, id=id).to_list_dict() print(json.dumps(res, indent=2)) @@ -26,8 +26,8 @@ def main() -> None: """Parses arguments and calls `bfabric_delete`.""" client = Bfabric.from_config() parser = argparse.ArgumentParser() - parser.add_argument("endpoint", help="endpoint", choices=bfabric.endpoints) - parser.add_argument("id", help="id", type=int) + parser.add_argument("endpoint", help="endpoint", type=str) + parser.add_argument("id", help="id", type=int, nargs="+") args = parser.parse_args() bfabric_delete(client=client, endpoint=args.endpoint, id=args.id) diff --git a/docs/changelog.md b/docs/changelog.md index 3e260f0..6bc35e9 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -17,6 +17,7 @@ Versioning currently follows `X.Y.Z` where ### Changed - `bfabric_read.py` prints non-output information exclusively through logger. +- `bfabric_delete.py` accepts multiple ids at once and does not restrict entity types anymore. ## \[1.13.5\] - 2024-08-13