summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2017-03-16 22:36:51 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2017-03-16 22:36:51 -0400
commita5632e06cba42a26bb7d628631071d5cf0236e6f (patch)
tree09eb09272c30fa90995af675ca2383788dc669e1 /examples
parent2d4b43a4901122d7918af4030c440a3c93892a4f (diff)
downloadcmd2-git-a5632e06cba42a26bb7d628631071d5cf0236e6f.tar.gz
Added example of using a regular expression in a transcript test.
Also added a unit test for this feature.
Diffstat (limited to 'examples')
-rw-r--r--examples/exampleSession.txt1
-rw-r--r--examples/transcript_regex.txt18
2 files changed, 19 insertions, 0 deletions
diff --git a/examples/exampleSession.txt b/examples/exampleSession.txt
index a4eef91f..8ef39774 100644
--- a/examples/exampleSession.txt
+++ b/examples/exampleSession.txt
@@ -1,3 +1,4 @@
+# Run this transcript with "python example.py -t exampleSession.txt"
(Cmd) help
Documented commands (type help <topic>):
diff --git a/examples/transcript_regex.txt b/examples/transcript_regex.txt
new file mode 100644
index 00000000..9c4c7a48
--- /dev/null
+++ b/examples/transcript_regex.txt
@@ -0,0 +1,18 @@
+# Run this transcript with "python example.py -t transcript_regex.txt"
+# The regex for editor matches any word until first space.
+(Cmd) set
+abbrev: True
+autorun_on_edit: True
+case_insensitive: True
+colors: True
+continuation_prompt: >
+debug: False
+default_file_name: command.txt
+echo: False
+editor: /([^\s]+)/
+feedback_to_output: False
+locals_in_py: True
+maxrepeats: 3
+prompt: (Cmd)
+quiet: False
+timing: False