summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/subcommands.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/subcommands.py b/examples/subcommands.py
index 7cab74dd..eaadbb64 100755
--- a/examples/subcommands.py
+++ b/examples/subcommands.py
@@ -42,7 +42,10 @@ class SubcommandsExample(cmd2.Cmd):
parser_bar.add_argument('z', help='string')
parser_bar.set_defaults(func=bar)
- @with_argument_parser(base_parser)
+ # Create a list of subcommand names, which is used to enable tab-completion of sub-commands
+ subcommands = ['foo', 'bar']
+
+ @with_argument_parser(base_parser, subcommands)
def do_base(self, args):
"""Base command help"""
try: