diff options
Diffstat (limited to 'cmd2/cmd2.py')
-rwxr-xr-x | cmd2/cmd2.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 2cc412a9..69de58b0 100755 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -1606,6 +1606,10 @@ class Cmd(cmd.Cmd): tokens_to_parse = raw_tokens if preserve_quotes else tokens return completer.complete_command(tokens_to_parse, text, line, begidx, endidx) + def get_names(self): + """Return an alphabetized list of names comprising the attributes of the cmd2 class instance.""" + return dir(self) + def get_all_commands(self) -> List[str]: """Return a list of all commands""" return [name[len(COMMAND_FUNC_PREFIX):] for name in self.get_names() |