sane-bt-rm: support deleting multiple torrents in one invocation

This commit is contained in:
2025-03-02 05:25:28 +00:00
parent ccd343f0b6
commit 64a2d60d89

View File

@@ -14,13 +14,14 @@ def main():
parser = argparse.ArgumentParser(description="remove a torrent and trash its data")
TransmissionApi.add_arguments(parser)
parser.add_argument("torrent", help="numerical ID of the torrent in the transmission list (see sane-bt-show)")
parser.add_argument("torrent", help="numerical ID of the torrent in the transmission list (see sane-bt-show)", nargs="+")
args = parser.parse_args()
bt_api = TransmissionApi.from_arguments(args)
torrent = args.torrent
torrents = args.torrent
bt_api.rm_torrent(torrent)
for torrent in torrents:
bt_api.rm_torrent(torrent)
if __name__ == "__main__":
main()