diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-09-26 11:54:40 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-09-26 11:54:40 -0400 |
commit | e3d1bd12c2ecea2284d5af60cb5e903277ecb42c (patch) | |
tree | 02428f0a5a3238c20ee48188118d0f46a2a24e2d | |
parent | 26a9ea4277a61031274c48216aed21aae4e53eec (diff) | |
download | cmd2-git-e3d1bd12c2ecea2284d5af60cb5e903277ecb42c.tar.gz |
Added tab completion to macros
-rw-r--r-- | cmd2/cmd2.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index b40c8ded..8fdaa697 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -1452,6 +1452,10 @@ class Cmd(cmd.Cmd): except AttributeError: compfunc = self.completedefault + # Check if a macro was entered + elif command in self.macros: + compfunc = self.path_complete + # A valid command was not entered else: # Check if this command should be run as a shell command @@ -2277,6 +2281,9 @@ class Cmd(cmd.Cmd): " If you want to use redirection or pipes in the alias, then quote them to prevent\n" " the 'alias create' command itself from being redirected\n" "\n" + " Since aliases are resolved during parsing, tab completion will function as it would\n" + " for the actual command the alias resolves to." + "\n" "Examples:\n" " alias ls !ls -lF\n" " alias create show_log !cat \"log file.txt\"\n" |