From a6ed2bcf69744975d4f54c8ae3eee8aec322fb20 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Sat, 31 Mar 2018 03:09:39 -0400 Subject: Forgot that topic and command names can overlap --- cmd2.py | 6 +++--- 1 file 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 -- cgit v1.2.1