Skip to content

Commit 9cbfa4d

Browse files
authored
Merge pull request #401 from python-cmd2/complete_alias-py2
Completing alias names in value field of alias command since aliases …
2 parents 60605c8 + 2e79eba commit 9cbfa4d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cmd2.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2849,10 +2849,13 @@ def do_alias(self, arglist):
28492849

28502850
def complete_alias(self, text, line, begidx, endidx):
28512851
""" Tab completion for alias """
2852+
alias_names = set(self.aliases.keys())
2853+
visible_commands = set(self.get_visible_commands())
2854+
28522855
index_dict = \
28532856
{
2854-
1: self.aliases,
2855-
2: self.get_visible_commands()
2857+
1: alias_names,
2858+
2: list(alias_names | visible_commands)
28562859
}
28572860
return self.index_based_complete(text, line, begidx, endidx, index_dict, self.path_complete)
28582861

0 commit comments

Comments
 (0)