bin: improve scripts for testing

This commit is contained in:
xeruf 2021-11-07 00:28:57 +01:00
parent 6eb61dc70b
commit 08c1dcd2d7
2 changed files with 12 additions and 1 deletions

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
{ {
echo "$# Args: $@" echo "$# Args: $@"
echo "${@:-default}" | sed 's/\w\+/\0-w/g' #echo "${@:-default}" | sed 's/\w\+/\0-w/g'
for last; do true; done for last; do true; done
echo "Last arg: $last" echo "Last arg: $last"
} | tee /tmp/args$(date +%s) } | tee /tmp/args$(date +%s)

11
.local/bin/scripts/titest Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
# Compare select terminal image viewers
# Args: <height> [images]...
runti() {
which "$1" >/dev/null &&
highlight "$*" && "$@"
}
cols="$(expr $(tput cols) / $1 / 4 \| 1)"
runti timg --grid=${cols} -g $(tput cols)x$(expr $1 \* $cols) "${@:2}"
runti viu --name -h $1 "${@:2}"
runti tiv -h $1 -c $cols "${@:2}"