Skip to content

Commit a6ed2bc

Browse files
committed
Forgot that topic and command names can overlap
1 parent fd546ec commit a6ed2bc

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

cmd2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2183,9 +2183,9 @@ def complete_help(self, text, line, begidx, endidx):
21832183
if index == cmd_index:
21842184

21852185
# Complete token against topics and visible commands
2186-
topics = self.get_help_topics()
2187-
visible_commands = self.get_visible_commands()
2188-
strs_to_match = topics + visible_commands
2186+
topics = set(self.get_help_topics())
2187+
visible_commands = set(self.get_visible_commands())
2188+
strs_to_match = list(topics | visible_commands)
21892189
matches = self.basic_complete(text, line, begidx, endidx, strs_to_match)
21902190

21912191
# Check if we are completing a subcommand

0 commit comments

Comments
 (0)