mirror of
https://github.com/notwa/rc
synced 2025-02-05 07:43:22 -08:00
add handling for perl to compatibility table
This commit is contained in:
parent
a0c83289e3
commit
4c128d42f8
1 changed files with 10 additions and 3 deletions
13
tableize
13
tableize
|
@ -55,6 +55,7 @@ tableize() {
|
||||||
'!/usr/bin/env bash') pref=bash;;
|
'!/usr/bin/env bash') pref=bash;;
|
||||||
'!/usr/bin/env dash') pref=dash;;
|
'!/usr/bin/env dash') pref=dash;;
|
||||||
'!/usr/bin/env false') pref=false;;
|
'!/usr/bin/env false') pref=false;;
|
||||||
|
'!/usr/bin/env perl') pref=perl;;
|
||||||
'!/usr/bin/env sh') pref=sh;;
|
'!/usr/bin/env sh') pref=sh;;
|
||||||
'!/usr/bin/env zsh') pref=zsh;;
|
'!/usr/bin/env zsh') pref=zsh;;
|
||||||
'!/usr/bin/sh') pref=sh;;
|
'!/usr/bin/sh') pref=sh;;
|
||||||
|
@ -72,16 +73,22 @@ tableize() {
|
||||||
local yay='✔️' # yay='y'
|
local yay='✔️' # yay='y'
|
||||||
local nay='⭕' # nay='✖️' # nay='n'
|
local nay='⭕' # nay='✖️' # nay='n'
|
||||||
local huh='❔' # huh='?'
|
local huh='❔' # huh='?'
|
||||||
|
local etc='*n/a*'
|
||||||
|
|
||||||
# TODO: escape underscores in filenames.
|
# TODO: escape underscores in filenames.
|
||||||
printf '| [%s](#%s) ' "$fn" "$fn"
|
printf '| [%s](#%s) ' "$fn" "$fn"
|
||||||
printf "%$(( 40 - 2 * ${#fn} ))s" '' # funky way to pad the rest of the column
|
printf "%$(( 40 - 2 * ${#fn} ))s" '' # funky way to pad the rest of the column
|
||||||
[ "$pref" != false ] || pref='**false**'
|
|
||||||
[ "$pref" != sh ] || pref='*sh*'
|
local p="$pref"
|
||||||
[ -n "$pref" ] && printf '| %10s ' "$pref" || printf '| %9s%s ' '' "$huh"
|
[ "$pref" != false ] || p='**false**'
|
||||||
|
[ "$pref" != perl ] || p='**perl**'
|
||||||
|
[ "$pref" != sh ] || p='*sh*'
|
||||||
|
[ -n "$p" ] && printf '| %10s ' "$p" || printf '| %9s%s ' '' "$huh"
|
||||||
|
|
||||||
local t=
|
local t=
|
||||||
for t in "$zsh" "$bash" "$dash" "$ash"; do
|
for t in "$zsh" "$bash" "$dash" "$ash"; do
|
||||||
local w="$huh"
|
local w="$huh"
|
||||||
|
[ "$pref" != perl ] || w="$etc"
|
||||||
[ "$t" != yes ] || w="$yay"
|
[ "$t" != yes ] || w="$yay"
|
||||||
[ "$t" != no ] || w="$nay"
|
[ "$t" != no ] || w="$nay"
|
||||||
# can't use '%4s' here because printf gets confused by UTF-8.
|
# can't use '%4s' here because printf gets confused by UTF-8.
|
||||||
|
|
Loading…
Add table
Reference in a new issue