summaryrefslogtreecommitdiff
path: root/examples/tab_completion.py
diff options
context:
space:
mode:
authorkotfu <jared@kotfu.net>2018-05-24 19:07:45 -0600
committerGitHub <noreply@github.com>2018-05-24 19:07:45 -0600
commitcad21a60fa92ebe4a7c177142d273f9f7497967b (patch)
tree3cfa590653af8b7570bd4073384467d2ca736fa0 /examples/tab_completion.py
parent5d64ebee348aeffb02fc385f903c9af431e3721b (diff)
parent190fecb34ac91e25f64615f378d6d59ef6d77de8 (diff)
downloadcmd2-git-cad21a60fa92ebe4a7c177142d273f9f7497967b.tar.gz
Merge pull request #413 from python-cmd2/speedup_import
Defer certain imports
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))