mirror of
https://github.com/notwa/rc
synced 2024-11-05 06:49:03 -08:00
add a bunch more shells to the compatibility table
This commit is contained in:
parent
7fe356faf7
commit
89135abc09
2 changed files with 21 additions and 9 deletions
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env false
|
#!/usr/bin/env false
|
||||||
# compat: -ash +bash -dash +zsh
|
# compat: -ash +bash -dash -hush +ksh +mksh -oksh +osh -posh +yash +zsh
|
||||||
|
|
||||||
whoa=(
|
whoa=(
|
||||||
-Wall
|
-Wall
|
||||||
|
|
20
tableize
20
tableize
|
@ -12,8 +12,8 @@ tableize() {
|
||||||
|
|
||||||
# the script column has to be stupid wide because names are repeated twice for anchors.
|
# the script column has to be stupid wide because names are repeated twice for anchors.
|
||||||
# column lengths: 45, 10, 4, 4, 4, 4
|
# column lengths: 45, 10, 4, 4, 4, 4
|
||||||
printf '%s\n' '| script | preference | zsh | bash | dash | ash |'
|
printf '%s\n' '| script | preference | ash | bash | dash | ksh | mksh | oksh | osh | posh | yash | zsh |'
|
||||||
printf '%s\n' '| --------------------------------------------- | ---------- | ---- | ---- | ---- | ---- |'
|
printf '%s\n' '| --------------------------------------------- | ---------- | --- | ---- | ---- | --- | ---- | ---- | --- | ---- | ---- | --- |'
|
||||||
|
|
||||||
local f=
|
local f=
|
||||||
for f in sh/*; do
|
for f in sh/*; do
|
||||||
|
@ -25,7 +25,7 @@ tableize() {
|
||||||
[ "$fn" = "${fn#_}" ] || continue # completion files
|
[ "$fn" = "${fn#_}" ] || continue # completion files
|
||||||
[ "$fn" = "${fn%.bak}" ] || continue # backup files
|
[ "$fn" = "${fn%.bak}" ] || continue # backup files
|
||||||
|
|
||||||
local i=0 zsh= bash= dash= ash= pref=
|
local i=0 ash= bash= dash= ksh= mksh= oksh= osh= posh= yash= zsh= pref=
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
: $((i+=1))
|
: $((i+=1))
|
||||||
[ $i -le 10 ] || break # act like head -n10
|
[ $i -le 10 ] || break # act like head -n10
|
||||||
|
@ -76,10 +76,22 @@ tableize() {
|
||||||
(+ash) [ "$check" = 0 ] || ash=yes;;
|
(+ash) [ "$check" = 0 ] || ash=yes;;
|
||||||
(+bash) [ "$check" = 0 ] || bash=yes;;
|
(+bash) [ "$check" = 0 ] || bash=yes;;
|
||||||
(+dash) [ "$check" = 0 ] || dash=yes;;
|
(+dash) [ "$check" = 0 ] || dash=yes;;
|
||||||
|
(+ksh) [ "$check" = 0 ] || ksh=yes;;
|
||||||
|
(+mksh) [ "$check" = 0 ] || mksh=yes;;
|
||||||
|
(+oksh) [ "$check" = 0 ] || oksh=yes;;
|
||||||
|
(+osh) [ "$check" = 0 ] || osh=yes;;
|
||||||
|
(+posh) [ "$check" = 0 ] || posh=yes;;
|
||||||
|
(+yash) [ "$check" = 0 ] || yash=yes;;
|
||||||
(+zsh) [ "$check" = 0 ] || zsh=yes;;
|
(+zsh) [ "$check" = 0 ] || zsh=yes;;
|
||||||
(-ash) [ "$check" = 0 ] || ash=no;;
|
(-ash) [ "$check" = 0 ] || ash=no;;
|
||||||
(-bash) [ "$check" = 0 ] || bash=no;;
|
(-bash) [ "$check" = 0 ] || bash=no;;
|
||||||
(-dash) [ "$check" = 0 ] || dash=no;;
|
(-dash) [ "$check" = 0 ] || dash=no;;
|
||||||
|
(-ksh) [ "$check" = 0 ] || ksh=no;;
|
||||||
|
(-mksh) [ "$check" = 0 ] || mksh=no;;
|
||||||
|
(-oksh) [ "$check" = 0 ] || oksh=no;;
|
||||||
|
(-osh) [ "$check" = 0 ] || osh=no;;
|
||||||
|
(-posh) [ "$check" = 0 ] || posh=no;;
|
||||||
|
(-yash) [ "$check" = 0 ] || yash=no;;
|
||||||
(-zsh) [ "$check" = 0 ] || zsh=no;;
|
(-zsh) [ "$check" = 0 ] || zsh=no;;
|
||||||
('#'*) break;;
|
('#'*) break;;
|
||||||
esac done
|
esac done
|
||||||
|
@ -108,7 +120,7 @@ tableize() {
|
||||||
[ -n "$p" ] && printf '| %10s ' "$p" || printf '| %9s%s ' '' "$huh"
|
[ -n "$p" ] && printf '| %10s ' "$p" || printf '| %9s%s ' '' "$huh"
|
||||||
|
|
||||||
local t=
|
local t=
|
||||||
for t in "$zsh" "$bash" "$dash" "$ash"; do
|
for t in "$ash" "$bash" "$dash" "$ksh" "$mksh" "$oksh" "$osh" "$posh" "$yash" "$zsh"; do
|
||||||
local w="$huh"
|
local w="$huh"
|
||||||
[ "$pref" != perl ] || w="$etc"
|
[ "$pref" != perl ] || w="$etc"
|
||||||
[ "$t" != yes ] || w="$yay"
|
[ "$t" != yes ] || w="$yay"
|
||||||
|
|
Loading…
Reference in a new issue