summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-09-16 15:43:54 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-09-16 15:43:54 -0400
commit89fa7fb81f9e12cdabd10009b34b673bd1dadc14 (patch)
tree1bee97e5275edbd905cff03d2b113e72c7061b56 /cmd2/cmd2.py
parente6585d155810f9afb2a246a71f939e1c0d511694 (diff)
parentf10674e6db245da5b4062aef3391d54c33277255 (diff)
downloadcmd2-git-89fa7fb81f9e12cdabd10009b34b673bd1dadc14.tar.gz
Merge branch 'master' into completion_state
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 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()