mirror of
https://github.com/sharkdp/fd
synced 2024-10-04 14:59:15 +00:00
Small screencast updates
This commit is contained in:
parent
26beaf97a6
commit
6d83eea32b
|
@ -27,7 +27,7 @@ While it does not seek to mirror all of *find*'s powerful functionality, it prov
|
||||||
|
|
||||||
## Demo
|
## Demo
|
||||||
|
|
||||||
![Demo](./screencast.svg)
|
![Demo](doc/screencast.svg)
|
||||||
|
|
||||||
## Benchmark
|
## Benchmark
|
||||||
Let's search my home folder for files that end in `[0-9].jpg`. It contains ~150.000
|
Let's search my home folder for files that end in `[0-9].jpg`. It contains ~150.000
|
||||||
|
|
60
doc/screencast.sh
Normal file
60
doc/screencast.sh
Normal 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
1
doc/screencast.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 115 KiB |
|
@ -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 |
Loading…
Reference in a new issue