24 Mar 2014 04:22:20 UTC
- Distribution: App-Cleo
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (635 / 0 / 0)
- KwaliteeBus factor: 0
- 20.66% Coverage
- License: perl_5
- Activity24 month
- Download (5.41KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
cleo - Play back shell commands for live demonstrations
cleois a utility for playing back pre-recorded shell commands in a live demonstration.
cleodisplays the commands as if you had actually typed them and then executes them interactively.
There is probably an easy way to do this with
expector a similar tool. But I couldn't figure it out, so I built this. Your mileage may vary.
cleoalways pauses and waits for a keypress before displaying a command and before executing it. Pressing any key besides those listed below will advance the playback:
Key Action ------------------------------------------------------------------ s skip the current command r redo the current command p redo the previous command q quit playback
cleoreads commands from a file. Each line is treated as one command. Blank lines and those starting with
#will be ignored. The commands themselves can be anything that you would type into an interactive shell. You can also add a few special tokens that
Commands starting with
!!!(three exclamation points) are not displayed and will be executed immediately. This is useful for running setup commands at the beginning of your demonstration.
Within a command,
%%%(three percent signs) will cause
cleoto pause and wait for a keypress before displaying the rest of the command. This is useful if you want to stop in the middle of a command to give some explanation.
cleodisplays and executes the commands verbatim. Note that some interactive commands like
vimare picky about STDOUT and STDIN. To make them work properly with
cleo, you may need to force them to attach to the terminal like this:
(exec < /dev/tty vim)
The command file that I use for that presentation is included inside this distribution at examples/pinto.demo. This file is for illustration only, so don't expect it to actually work for you.
cleoonly works on Unix-like platforms. It may work on Windows if you use Cygwin. Personally, I have only used
cleoon Mac OS X.
- Jump to arbitrary command number
- Support backspacing in recorded command
- Support multi-line recorded commands
- Write unit tests
Jeffrey Ryan Thalhammer <email@example.com>
Copyright (c) 2014, Imaginative Software Systems