sane-bt-rm: support deleting multiple torrents in one invocation
This commit is contained in:
@@ -14,13 +14,14 @@ def main():
|
|||||||
|
|
||||||
parser = argparse.ArgumentParser(description="remove a torrent and trash its data")
|
parser = argparse.ArgumentParser(description="remove a torrent and trash its data")
|
||||||
TransmissionApi.add_arguments(parser)
|
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()
|
args = parser.parse_args()
|
||||||
bt_api = TransmissionApi.from_arguments(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__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
Reference in New Issue
Block a user