diff options
author | kotfu <kotfu@kotfu.net> | 2018-05-23 21:16:17 -0600 |
---|---|---|
committer | kotfu <kotfu@kotfu.net> | 2018-05-23 21:16:17 -0600 |
commit | 6780baa83457f7e99ba3a9c4f6a3c27701326ac5 (patch) | |
tree | c130136619c740645c45326a2ada0fcffa9f65a2 /examples/tab_completion.py | |
parent | 1a70b90f375997751bc7df16b5e3f58c6194c71b (diff) | |
download | cmd2-git-6780baa83457f7e99ba3a9c4f6a3c27701326ac5.tar.gz |
Standardize cmd2 imports in tests and examples
Diffstat (limited to 'examples/tab_completion.py')
-rwxr-xr-x | examples/tab_completion.py | 7 |
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)) |