diff options
Diffstat (limited to 'cmd2.py')
-rwxr-xr-x | cmd2.py | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -2105,9 +2105,9 @@ class Cmd(cmd.Cmd): else: # Complete token against aliases and command names - alias_names = list(self.aliases.keys()) - visible_commands = self.get_visible_commands() - strs_to_match = alias_names + visible_commands + alias_names = set(self.aliases.keys()) + visible_commands = set(self.get_visible_commands()) + strs_to_match = list(alias_names | visible_commands) self.completion_matches = self.basic_complete(text, line, begidx, endidx, strs_to_match) # Handle single result @@ -2755,12 +2755,6 @@ Usage: Usage: alias [<name> <value>] name = arglist[0] value = ' '.join(arglist[1:]) - # Make sure the alias does not match an existing command - cmd_func = self._func_named(name) - if cmd_func is not None: - self.perror("Alias names cannot match an existing command: {!r}".format(name), traceback_war=False) - return - # Check for a valid name for cur_char in name: if cur_char not in self.identchars: |