summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2/cmd2.py')
-rwxr-xr-xcmd2/cmd2.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index a0a49a51..610ec897 100755
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -1596,6 +1596,10 @@ class Cmd(cmd.Cmd):
tokens, _ = self.tokens_for_completion(line, begidx, endidx)
return completer.complete_command(tokens, 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()