Console: Fix missing trailing space for command options with tab complete

This commit is contained in:
Calum Lind 2012-03-26 19:27:01 +01:00
parent e2608a0ac9
commit 211c27aaae

View File

@ -472,7 +472,7 @@ class Legacy(BaseMode):
def write(self, line): def write(self, line):
""" """
Writes a line out Writes a line out
:param line: str, the line to print :param line: str, the line to print
@ -502,7 +502,7 @@ class Legacy(BaseMode):
# line. # line.
for cmd in self.console._commands: for cmd in self.console._commands:
if cmd.startswith(line): if cmd.startswith(line):
possible_matches.append(cmd + " ") possible_matches.append(cmd)
line_prefix = "" line_prefix = ""
else: else:
@ -522,7 +522,7 @@ class Legacy(BaseMode):
# return it, else we need to print out the matches without modifying # return it, else we need to print out the matches without modifying
# the line. # the line.
elif len(possible_matches) == 1: elif len(possible_matches) == 1:
new_line = line_prefix + possible_matches[0] new_line = line_prefix + possible_matches[0] + " "
return (new_line, len(new_line)) return (new_line, len(new_line))
else: else:
if second_hit: if second_hit:
@ -553,9 +553,9 @@ class Legacy(BaseMode):
# Find all possible matches # Find all possible matches
for torrent_id, torrent_name in self.torrents: for torrent_id, torrent_name in self.torrents:
if torrent_id.startswith(line): if torrent_id.startswith(line):
possible_matches.append(torrent_id + " ") possible_matches.append(torrent_id)
if torrent_name.startswith(line): if torrent_name.startswith(line):
possible_matches.append(torrent_name + " ") possible_matches.append(torrent_name)
return possible_matches return possible_matches