summaryrefslogtreecommitdiff
path: root/examples/tab_autocompletion.py
diff options
context:
space:
mode:
authorkotfu <kotfu@kotfu.net>2018-05-23 22:28:03 -0600
committerkotfu <kotfu@kotfu.net>2018-05-23 22:28:03 -0600
commit496933d7053f7a5de57e89b3e274db51c36de4f4 (patch)
treed4699a7d853f3fcb1ac8692b3396e55fcca81f9b /examples/tab_autocompletion.py
parentda0e211d40f89c36f81752ac0de3a971a86d8642 (diff)
downloadcmd2-git-496933d7053f7a5de57e89b3e274db51c36de4f4.tar.gz
Fix import stragglers
Diffstat (limited to 'examples/tab_autocompletion.py')
-rwxr-xr-xexamples/tab_autocompletion.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/tab_autocompletion.py b/examples/tab_autocompletion.py
index e2c5b3da..d1726841 100755
--- a/examples/tab_autocompletion.py
+++ b/examples/tab_autocompletion.py
@@ -11,6 +11,7 @@ import itertools
from typing import List
import cmd2
+from cmd2 import argparse_completer
actors = ['Mark Hamill', 'Harrison Ford', 'Carrie Fisher', 'Alec Guinness', 'Peter Mayhew',
'Anthony Daniels', 'Adam Driver', 'Daisy Ridley', 'John Boyega', 'Oscar Isaac',
@@ -113,7 +114,7 @@ class TabCompleteExample(cmd2.Cmd):
# - The help output for arguments with multiple flags or with append=True is more concise
# - ACArgumentParser adds the ability to specify ranges of argument counts in 'nargs'
- suggest_parser = cmd2.argparse_completer.ACArgumentParser()
+ suggest_parser = argparse_completer.ACArgumentParser()
suggest_parser.add_argument('-t', '--type', choices=['movie', 'show'], required=True)
suggest_parser.add_argument('-d', '--duration', nargs=(1, 2), action='append',
@@ -138,7 +139,7 @@ class TabCompleteExample(cmd2.Cmd):
suggest_parser_hybrid = argparse.ArgumentParser()
# This registers the custom narg range handling
- cmd2.argparse_completer.register_custom_actions(suggest_parser_hybrid)
+ argparse_completer.register_custom_actions(suggest_parser_hybrid)
suggest_parser_hybrid.add_argument('-t', '--type', choices=['movie', 'show'], required=True)
suggest_parser_hybrid.add_argument('-d', '--duration', nargs=(1, 2), action='append',