From 6bc3c7528b02f0160c31eb008f1218ee4c3344bc Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Sat, 20 Jan 2018 20:01:24 -0500 Subject: History enhancements History changes: - Unknown commands are no longer saved in the history - history command now has a -t option to generate a transcript based on commands in the history Also: - Moved examples transcripts from examples to examples/transcripts - Added a new transcript for use with the pirate.py example --- examples/transcripts/exampleSession.txt | 17 +++++++++++++++++ examples/transcripts/pirate.transcript | 10 ++++++++++ examples/transcripts/transcript_regex.txt | 17 +++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 examples/transcripts/exampleSession.txt create mode 100644 examples/transcripts/pirate.transcript create mode 100644 examples/transcripts/transcript_regex.txt (limited to 'examples/transcripts') diff --git a/examples/transcripts/exampleSession.txt b/examples/transcripts/exampleSession.txt new file mode 100644 index 00000000..840bee60 --- /dev/null +++ b/examples/transcripts/exampleSession.txt @@ -0,0 +1,17 @@ +# Run this transcript with "python argparse_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 +(Cmd) set +abbrev: False +colors: /(True|False)/ +continuation_prompt: >/ / +debug: False +echo: False +editor: /.*?/ +feedback_to_output: False +locals_in_py: True +maxrepeats: 3 +prompt: (Cmd)/ / +quiet: False +timing: False diff --git a/examples/transcripts/pirate.transcript b/examples/transcripts/pirate.transcript new file mode 100644 index 00000000..570f0cd7 --- /dev/null +++ b/examples/transcripts/pirate.transcript @@ -0,0 +1,10 @@ +arrr> loot +Now we gots 1 doubloons +arrr> loot +Now we gots 2 doubloons +arrr> loot +Now we gots 3 doubloons +arrr> drink 3 +Now we gots 0 doubloons +arrr> yo --ho 3 rum +yo ho ho ho and a bottle of rum diff --git a/examples/transcripts/transcript_regex.txt b/examples/transcripts/transcript_regex.txt new file mode 100644 index 00000000..7d017dee --- /dev/null +++ b/examples/transcripts/transcript_regex.txt @@ -0,0 +1,17 @@ +# Run this transcript with "python example.py -t transcript_regex.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 +(Cmd) set +abbrev: True +colors: /(True|False)/ +continuation_prompt: >/ / +debug: False +echo: False +editor: /.*?/ +feedback_to_output: False +locals_in_py: True +maxrepeats: 3 +prompt: (Cmd)/ / +quiet: False +timing: False -- cgit v1.2.1