mirror of
https://github.com/sharkdp/fd.git
synced 2024-11-17 09:28:25 +01:00
Ensure -h output can be read at end of cast
This commit is contained in:
parent
b269f4902e
commit
4fea5f3a3c
1 changed files with 28 additions and 12 deletions
|
@ -1,34 +1,50 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
PROMPT="▶ "
|
||||
PROMPT="▶"
|
||||
|
||||
enter() {
|
||||
IFS='%'
|
||||
type $PROMPT
|
||||
prompt
|
||||
type $1
|
||||
sleep 0.5
|
||||
printf '%b' " ⏎\n"
|
||||
sleep 0.1
|
||||
eval $1
|
||||
type "\n"
|
||||
unset IFS
|
||||
}
|
||||
|
||||
prompt() {
|
||||
printf $PROMPT
|
||||
type " "
|
||||
}
|
||||
|
||||
type() {
|
||||
printf '%b' $1 | pv -qL $[10+(-2 + RANDOM%5)]
|
||||
}
|
||||
|
||||
enter "fd"
|
||||
main() {
|
||||
IFS='%'
|
||||
|
||||
enter "fd -e md"
|
||||
enter "fd"
|
||||
|
||||
enter "fd -e md --exec wc -l"
|
||||
enter "fd -e md"
|
||||
|
||||
enter "fd mod"
|
||||
enter "fd -e md --exec wc -l"
|
||||
|
||||
enter "fd sh"
|
||||
enter "fd mod"
|
||||
|
||||
enter "fd -H sample"
|
||||
enter "fd sh"
|
||||
|
||||
enter "fd -h"
|
||||
enter "fd -H sample"
|
||||
|
||||
enter "fd -h"
|
||||
|
||||
prompt
|
||||
|
||||
sleep 3
|
||||
|
||||
unset IFS
|
||||
|
||||
echo ""
|
||||
}
|
||||
|
||||
main
|
Loading…
Reference in a new issue