FILENAME argument is optional for command 'getfile' (closes #683)

This commit is contained in:
Romain Bignon 2011-07-05 16:27:06 +02:00
commit c74216ccf8

View file

@ -127,16 +127,19 @@ class Weboorrents(ReplApplication):
def do_getfile(self, line):
"""
getfile ID FILENAME
getfile ID [FILENAME]
Get the .torrent file.
FILENAME is where to write the file. If FILENAME is '-',
the file is written to stdout.
"""
id, dest = self.parse_command_args(line, 2, 2)
id, dest = self.parse_command_args(line, 2, 1)
_id, backend_name = self.parse_id(id)
if dest is None:
dest = '%s.torrent' % _id
for backend, buf in self.do('get_torrent_file', _id, backends=backend_name):
if buf:
if dest == '-':