X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/a552717b456a77062808b59fbecfe58a5d4e84df..HEAD:/shell.plp diff --git a/shell.plp b/shell.plp index 85ababa..75ea57e 100644 --- a/shell.plp +++ b/shell.plp @@ -10,7 +10,7 @@ Html({ say "

Shell compatibility

\n"; -my $data = do 'shell.inc.pl' or die $@ || $!; +my $data = Data('shell'); my @agents = keys %{ $data->{agents} }; print ''; @@ -22,8 +22,13 @@ my $header = join('', '', '', $header; say ''; @@ -34,32 +39,36 @@ sub saytitlecol { print '
feature', (map { - sprintf('%s', Entity($_->{name})) - } @{ $data->{agents} }{@agents}), + sprintf('%s', + (map { + sprintf ' title="%s"', Entity($_) + } $data->{agents}->{$_}->{name} // ()), + $_ + ) + } @agents), ); print '
', Entity($row->{title}); } -my %DSTATS = ( - Y => 'feature can be done', - N => 'feature is not present', - F => 'feature can only be done by using the shells function mechanism', - L => 'the readline library must be linked into the shell to enable this feature', -); -my %CSTATS = ( - N => 'l1', - F => 'l2', - L => 'l4', - Y => 'l5', +my %TSTATS = ( + l5 => '✔', + l4 => '✔', + l3 => '±', + l2 => '*', + l1 => '✘', ); sub saysupportcols { my ($row, $agent) = @_; - my $stat = $row->{support}->{$agent}; + my $support = $row->{support}->{$agent}; + my $level = ( + !defined $support ? 'l1' : + ref $support ne 'HASH' ? 'l0' : + $support->{alt} ? 'l2' : + $support->{partial} ? 'l3' : + $support->{optional} ? 'l4' : + 'l5' + ); my $title = join(' ', - $DSTATS{$stat} // 'unknown support', - 'in', $agent, + defined $support ? 'supported' : 'unsupported', + 'in', $data->{agents}->{$agent}->{abbr} // $agent, ); + $title .= " ($_)" + for ref $support && ($support->{note} // $support->{optional}) || (); + my $header = defined $support ? '✔' : '✘'; printf('%s', - join(' ', - X => $CSTATS{$stat}, - ), + join(' ', X => $level), $title, - $stat, + $TSTATS{$level} // (ref $support ? '?' : $support), ); }