summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2018-03-31 03:09:39 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2018-03-31 03:09:39 -0400
commita6ed2bcf69744975d4f54c8ae3eee8aec322fb20 (patch)
tree5ad69f79cc4ab53d9b7508c4dac556b0edcedef7 /cmd2.py
parentfd546ec1a4e0927cfc09b1b778456f26054e629f (diff)
downloadcmd2-git-a6ed2bcf69744975d4f54c8ae3eee8aec322fb20.tar.gz
Forgot that topic and command names can overlap
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd2.py b/cmd2.py
index d2111dff..4453ea15 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -2183,9 +2183,9 @@ class Cmd(cmd.Cmd):
if index == cmd_index:
# Complete token against topics and visible commands
- topics = self.get_help_topics()
- visible_commands = self.get_visible_commands()
- strs_to_match = topics + visible_commands
+ topics = set(self.get_help_topics())
+ visible_commands = set(self.get_visible_commands())
+ strs_to_match = list(topics | visible_commands)
matches = self.basic_complete(text, line, begidx, endidx, strs_to_match)
# Check if we are completing a subcommand