diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-09-16 15:43:54 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-09-16 15:43:54 -0400 |
commit | 89fa7fb81f9e12cdabd10009b34b673bd1dadc14 (patch) | |
tree | 1bee97e5275edbd905cff03d2b113e72c7061b56 /cmd2/cmd2.py | |
parent | e6585d155810f9afb2a246a71f939e1c0d511694 (diff) | |
parent | f10674e6db245da5b4062aef3391d54c33277255 (diff) | |
download | cmd2-git-89fa7fb81f9e12cdabd10009b34b673bd1dadc14.tar.gz |
Merge branch 'master' into completion_state
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() |