From 4c128d42f87f60410de92f4043d60435b12bc705 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Fri, 29 Oct 2021 16:22:13 +0200 Subject: [PATCH] add handling for perl to compatibility table --- tableize | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tableize b/tableize index a6e9c64..b2d398f 100755 --- a/tableize +++ b/tableize @@ -55,6 +55,7 @@ tableize() { '!/usr/bin/env bash') pref=bash;; '!/usr/bin/env dash') pref=dash;; '!/usr/bin/env false') pref=false;; + '!/usr/bin/env perl') pref=perl;; '!/usr/bin/env sh') pref=sh;; '!/usr/bin/env zsh') pref=zsh;; '!/usr/bin/sh') pref=sh;; @@ -72,16 +73,22 @@ tableize() { local yay='✔️' # yay='y' local nay='⭕' # nay='✖️' # nay='n' local huh='❔' # huh='?' + local etc='*n/a*' # TODO: escape underscores in filenames. printf '| [%s](#%s) ' "$fn" "$fn" printf "%$(( 40 - 2 * ${#fn} ))s" '' # funky way to pad the rest of the column - [ "$pref" != false ] || pref='**false**' - [ "$pref" != sh ] || pref='*sh*' - [ -n "$pref" ] && printf '| %10s ' "$pref" || printf '| %9s%s ' '' "$huh" + + local p="$pref" + [ "$pref" != false ] || p='**false**' + [ "$pref" != perl ] || p='**perl**' + [ "$pref" != sh ] || p='*sh*' + [ -n "$p" ] && printf '| %10s ' "$p" || printf '| %9s%s ' '' "$huh" + local t= for t in "$zsh" "$bash" "$dash" "$ash"; do local w="$huh" + [ "$pref" != perl ] || w="$etc" [ "$t" != yes ] || w="$yay" [ "$t" != no ] || w="$nay" # can't use '%4s' here because printf gets confused by UTF-8.