summaryrefslogtreecommitdiff
path: root/examples/tab_completion.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2018-05-25 12:35:24 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2018-05-25 12:35:24 -0400
commit4c67d3372db924e87be920d89aadecb946584b31 (patch)
treebf57a15570248a2e3fbfb058a817d6c743cc9167 /examples/tab_completion.py
parent0e4131ba2616bd33c9cb5e93105dbd6d511a71ab (diff)
parentcad21a60fa92ebe4a7c177142d273f9f7497967b (diff)
downloadcmd2-git-4c67d3372db924e87be920d89aadecb946584b31.tar.gz
Merge branch 'master' into pyshell_readline
Diffstat (limited to 'examples/tab_completion.py')
-rwxr-xr-xexamples/tab_completion.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/tab_completion.py b/examples/tab_completion.py
index 30fa283d..2ec7ff70 100755
--- a/examples/tab_completion.py
+++ b/examples/tab_completion.py
@@ -4,8 +4,7 @@
"""
import argparse
-from cmd2 import cmd2
-from cmd2.cmd2 import with_argparser, with_argument_list
+import cmd2
# List of strings used with flag and index based completion functions
food_item_strs = ['Pizza', 'Ham', 'Ham Sandwich', 'Potato']
@@ -24,7 +23,7 @@ class TabCompleteExample(cmd2.Cmd):
add_item_group.add_argument('-s', '--sport', help='Adds sport item')
add_item_group.add_argument('-o', '--other', help='Adds other item')
- @with_argparser(add_item_parser)
+ @cmd2.with_argparser(add_item_parser)
def do_add_item(self, args):
"""Add item command help"""
if args.food:
@@ -57,7 +56,7 @@ class TabCompleteExample(cmd2.Cmd):
return self.flag_based_complete(text, line, begidx, endidx, flag_dict=flag_dict)
- @with_argument_list
+ @cmd2.with_argument_list
def do_list_item(self, args):
"""List item command help"""
self.poutput("You listed {}".format(args))