summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2018-08-24 11:10:03 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2018-08-24 11:10:03 -0400
commitd953fb28d9afc82098512b0bd5f99104a9c193b8 (patch)
tree82bb7dbd87c4b8d9ebcbb7f1452795945d68ad5f /examples
parent0ad6b6d5417d0d126dc39550d5416f266cc47ec5 (diff)
downloadcmd2-git-d953fb28d9afc82098512b0bd5f99104a9c193b8.tar.gz
ACHelpFormatter now inherits from argparse.RawTextHelpFormatter to make it easier to format help/description text
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/tab_autocompletion.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/examples/tab_autocompletion.py b/examples/tab_autocompletion.py
index 38972358..6a2e683e 100755
--- a/examples/tab_autocompletion.py
+++ b/examples/tab_autocompletion.py
@@ -125,7 +125,9 @@ 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 = argparse_completer.ACArgumentParser()
+ suggest_description = "Suggest command demonstrates argparse customizations.\n"
+ suggest_description += "See hybrid_suggest and orig_suggest to compare the help output."
+ suggest_parser = argparse_completer.ACArgumentParser(description=suggest_description)
suggest_parser.add_argument('-t', '--type', choices=['movie', 'show'], required=True)
suggest_parser.add_argument('-d', '--duration', nargs=(1, 2), action='append',
@@ -136,12 +138,7 @@ class TabCompleteExample(cmd2.Cmd):
@cmd2.with_category(CAT_AUTOCOMPLETE)
@cmd2.with_argparser(suggest_parser)
def do_suggest(self, args) -> None:
- """Suggest command demonstrates argparse customizations
-
- See hybrid_suggest and orig_suggest to compare the help output.
-
-
- """
+ """Suggest command demonstrates argparse customizations"""
if not args.type:
self.do_help('suggest')