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

This commit is contained in:
Calum Lind 2012-03-23 00:05:32 +00:00
parent 56a24f16f2
commit f19caf69e0
1 changed files with 4 additions and 4 deletions

View File

@ -357,7 +357,7 @@ Please use commands from the command line, eg:\n
# line. # line.
for cmd in self._commands: for cmd in self._commands:
if cmd.startswith(line): if cmd.startswith(line):
possible_matches.append(cmd + " ") possible_matches.append(cmd)
line_prefix = "" line_prefix = ""
else: else:
@ -377,7 +377,7 @@ Please use commands from the command line, eg:\n
# 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:
@ -408,9 +408,9 @@ Please use commands from the command line, eg:\n
# 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