diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-08-24 15:11:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-24 15:11:25 -0400 |
commit | 42094e0d43c1a7373f4ed96d8d72dcf16f77a5f6 (patch) | |
tree | c517504559b45aff02e0d1da86d1ee30ef4454b7 /examples/tab_autocompletion.py | |
parent | 8c0abd3c1adb204737851c06cb9eeba16791f2c4 (diff) | |
parent | a5d4c71072ecb9a4c07fb88a8694726eaf5400a7 (diff) | |
download | cmd2-git-42094e0d43c1a7373f4ed96d8d72dcf16f77a5f6.tar.gz |
Merge pull request #508 from python-cmd2/ac_parser
ACHelpFormatter now inherits from argparse.RawTextHelpFormatter
Diffstat (limited to 'examples/tab_autocompletion.py')
-rwxr-xr-x | examples/tab_autocompletion.py | 11 |
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') |