Skip to content

Commit d79e377

Browse files
committed
Fix transcript_example.py example and associated transcript file
1 parent 7ad9ceb commit d79e377

File tree

3 files changed

+21
-14
lines changed

3 files changed

+21
-14
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ repos:
66
- id: check-merge-conflict
77
- id: check-toml
88
- id: end-of-file-fixer
9+
exclude: ^examples/transcripts/
910
- id: trailing-whitespace
11+
exclude: ^examples/transcripts/
1012

1113
- repo: https://github.com/astral-sh/ruff-pre-commit
1214
rev: "v0.14.13"

examples/transcript_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"""A sample application for cmd2.
33
44
Thanks to cmd2's built-in transcript testing capability, it also serves as a
5-
test suite for transcript_example.py when used with the transcript_regex.txt transcript.
5+
test suite for transcript_example.py when used with the transcripts/transcript_regex.txt transcript.
66
7-
Running `python transcript_example.py -t transcript_regex.txt` will run all the commands in
7+
Running `python transcript_example.py -t transcripts/transcript_regex.txt` will run all the commands in
88
the transcript against transcript_example.py, verifying that the output produced matches
99
the transcript.
1010
"""
Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
# Run this transcript with "python transcript_example.py -t transcript_regex.txt"
1+
# Run this transcript with "python transcript_example.py -t transcripts/transcript_regex.txt"
22
# Anything between two forward slashes, /, is interpreted as a regular expression (regex).
33
# The regex for editor will match whatever program you use.
44
# regexes on prompts just make the trailing space obvious
5-
(Cmd) set
6-
allow_style: '/(Terminal|Always|Never)/'
7-
always_show_hint: False
8-
debug: False
9-
echo: False
10-
editor: /.*?/
11-
feedback_to_output: False
12-
max_completion_items: 50
13-
maxrepeats: 3
14-
quiet: False
15-
timing: False
5+
(Cmd) set
6+
7+
Name Value Description
8+
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
9+
allow_style Terminal Allow ANSI text style sequences in output (valid values: Always, Never, Terminal)
10+
always_show_hint False Display tab completion hint even when completion suggestions print
11+
debug False Show full traceback on exception
12+
echo False Echo command issued into output
13+
editor /.*?/ Program used by 'edit'
14+
feedback_to_output False Include nonessentials in '|' and '>' results
15+
max_completion_items 50 Maximum number of CompletionItems to display during tab completion
16+
maxrepeats 3 max repetitions for speak command
17+
quiet False Don't print nonessential feedback
18+
scripts_add_to_history True Scripts and pyscripts add commands to history
19+
timing False Report execution times
20+

0 commit comments

Comments
 (0)