mirror of
https://github.com/notwa/rc
synced 2024-09-18 18:24:07 -07:00
count incompatible scripts for shells in the table
This commit is contained in:
parent
6c186f2795
commit
b080ea2629
1 changed files with 12 additions and 2 deletions
14
tableize
14
tableize
|
@ -15,6 +15,8 @@ tableize() {
|
||||||
printf '%s\n' '| script | preference | ash | bash | dash | ksh | mksh | oksh | osh | posh | yash | zsh |'
|
printf '%s\n' '| script | preference | ash | bash | dash | ksh | mksh | oksh | osh | posh | yash | zsh |'
|
||||||
printf '%s\n' '| --------------------------------------------- | ---------- | --- | ---- | ---- | --- | ---- | ---- | --- | ---- | ---- | --- |'
|
printf '%s\n' '| --------------------------------------------- | ---------- | --- | ---- | ---- | --- | ---- | ---- | --- | ---- | ---- | --- |'
|
||||||
|
|
||||||
|
local x_ash=0 x_bash=0 x_dash=0 x_ksh=0 x_mksh=0 x_oksh=0 x_osh=0 x_posh=0 x_yash=0 x_zsh=0
|
||||||
|
|
||||||
local f=
|
local f=
|
||||||
for f in sh/*; do
|
for f in sh/*; do
|
||||||
[ ! -d "$f" ] || continue # do not recurse or anything
|
[ ! -d "$f" ] || continue # do not recurse or anything
|
||||||
|
@ -123,8 +125,10 @@ tableize() {
|
||||||
[ "$pref" != sh ] || p='*sh*'
|
[ "$pref" != sh ] || p='*sh*'
|
||||||
[ -n "$p" ] && printf '| %10s ' "$p" || printf '| %9s%s ' '' "$huh"
|
[ -n "$p" ] && printf '| %10s ' "$p" || printf '| %9s%s ' '' "$huh"
|
||||||
|
|
||||||
local t=
|
local n=
|
||||||
for t in "$ash" "$bash" "$dash" "$ksh" "$mksh" "$oksh" "$osh" "$posh" "$yash" "$zsh"; do
|
for n in ash bash dash ksh mksh oksh osh posh yash zsh; do
|
||||||
|
eval "local t=\$$n"
|
||||||
|
[ "$t" != no ] || eval ": \$((x_$n+=1))"
|
||||||
local w="$huh"
|
local w="$huh"
|
||||||
[ "$pref" != perl ] || w="$etc"
|
[ "$pref" != perl ] || w="$etc"
|
||||||
[ "$t" != yes ] || w="$yay"
|
[ "$t" != yes ] || w="$yay"
|
||||||
|
@ -134,6 +138,12 @@ tableize() {
|
||||||
done
|
done
|
||||||
printf '|\n'
|
printf '|\n'
|
||||||
done
|
done
|
||||||
|
|
||||||
|
local n=
|
||||||
|
for n in ash bash dash ksh mksh oksh osh posh yash zsh; do
|
||||||
|
eval "local x=\$x_$n"
|
||||||
|
printf >&2 'incompatibilities for %4s: %2s\n' "$n" "$x"
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
tableize "$0" "$@"
|
tableize "$0" "$@"
|
||||||
|
|
Loading…
Reference in a new issue