diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-10-06 19:27:08 -0400 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-10-06 19:27:08 -0400 |
commit | d0654e136ae19837d8659b064205115ce59f940f (patch) | |
tree | a8b32b6c0d7d0bb07e8bf156c5fdccbc25004571 /examples | |
parent | e018924a28443e8e6f608d9b9796b2b826653490 (diff) | |
download | cmd2-git-d0654e136ae19837d8659b064205115ce59f940f.tar.gz |
Added warning to documentation about how help_foo won't be called for command foo if it uses an argparse decorator
Also:
- Renamed argparse_example.py to decorator_example.py
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/decorator_example.py (renamed from examples/argparse_example.py) | 9 | ||||
-rw-r--r-- | examples/transcripts/exampleSession.txt | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/examples/argparse_example.py b/examples/decorator_example.py index 236e2af4..5b8b303b 100755 --- a/examples/argparse_example.py +++ b/examples/decorator_example.py @@ -1,14 +1,13 @@ #!/usr/bin/env python # coding=utf-8 -"""A sample application for cmd2 showing how to use argparse to +"""A sample application showing how to use cmd2's argparse decorators to process command line arguments for your application. Thanks to cmd2's built-in transcript testing capability, it also -serves as a test suite for argparse_example.py when used with the -exampleSession.txt transcript. +serves as a test suite when used with the exampleSession.txt transcript. -Running `python argparse_example.py -t exampleSession.txt` will run -all the commands in the transcript against argparse_example.py, +Running `python decorator_example.py -t exampleSession.txt` will run +all the commands in the transcript against decorator_example.py, verifying that the output produced matches the transcript. """ import argparse diff --git a/examples/transcripts/exampleSession.txt b/examples/transcripts/exampleSession.txt index 38fb0659..8fa7c9bb 100644 --- a/examples/transcripts/exampleSession.txt +++ b/examples/transcripts/exampleSession.txt @@ -1,4 +1,4 @@ -# Run this transcript with "python argparse_example.py -t exampleSession.txt" +# Run this transcript with "python decorator_example.py -t exampleSession.txt" # The regex for colors is because no color on Windows. # The regex for editor will match whatever program you use. # regexes on prompts just make the trailing space obvious |