mirror of
https://github.com/sharkdp/fd.git
synced 2024-11-17 17:35:16 +01:00
56 lines
No EOL
661 B
Bash
56 lines
No EOL
661 B
Bash
#!/bin/sh
|
|
# Designed to be executed via svg-term:
|
|
# svg-term --command="sh screencast.sh" --out screencast.svg --padding=10
|
|
set -e
|
|
set -u
|
|
|
|
PROMPT="▶"
|
|
|
|
enter() {
|
|
INPUT=$1
|
|
DELAY=$2
|
|
|
|
prompt
|
|
sleep $DELAY
|
|
type $INPUT
|
|
sleep 0.5
|
|
printf '%b' "\n"
|
|
eval $INPUT
|
|
type "\n"
|
|
}
|
|
|
|
prompt() {
|
|
printf '%b ' $PROMPT | pv -q
|
|
}
|
|
|
|
type() {
|
|
printf '%b' $1 | pv -qL $[10+(-2 + RANDOM%5)]
|
|
}
|
|
|
|
main() {
|
|
IFS='%'
|
|
|
|
enter "fd" 0
|
|
|
|
enter "fd -e md" 1
|
|
|
|
enter "fd -e md --exec wc -l" 1
|
|
|
|
enter "fd mod" 1
|
|
|
|
enter "fd sh" 1
|
|
|
|
enter "fd -H sample" 1
|
|
|
|
enter "fd -h" 1
|
|
|
|
prompt
|
|
|
|
sleep 3
|
|
|
|
echo ""
|
|
|
|
unset IFS
|
|
}
|
|
|
|
main |