Small screencast updates

This commit is contained in:
sharkdp 2018-01-28 13:32:26 +01:00 committed by David Peter
parent 26beaf97a6
commit 6d83eea32b
5 changed files with 62 additions and 58 deletions

View File

@ -27,7 +27,7 @@ While it does not seek to mirror all of *find*'s powerful functionality, it prov
## Demo
![Demo](./screencast.svg)
![Demo](doc/screencast.svg)
## Benchmark
Let's search my home folder for files that end in `[0-9].jpg`. It contains ~150.000

60
doc/screencast.sh Normal file
View File

@ -0,0 +1,60 @@
#!/bin/bash
# Designed to be executed via svg-term from the fd root directory:
# svg-term --command="bash doc/screencast.sh" --out doc/screencast.svg --padding=10
set -e
set -u
PROMPT="▶"
enter() {
INPUT=$1
DELAY=1
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"
enter "fd app"
enter "fd sh"
enter "fd sh --type f"
enter "fd -e md"
enter "fd -e md --exec wc -l"
enter "fd '^[A-Z]'"
enter "fd --exclude src"
enter "fd --hidden sample"
prompt
sleep 3
echo ""
unset IFS
}
main

1
doc/screencast.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 115 KiB

View File

@ -1,56 +0,0 @@
#!/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

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 107 KiB