index: release v1.18 with only altgr index linked
[sheet.git] / shell.plp
index 85ababa7ea4d969e2ad7d7527d3fbfd27ee5721a..75ea57e2ddc97953f612724ad7ad283a04a4678d 100644 (file)
--- a/shell.plp
+++ b/shell.plp
@@ -10,7 +10,7 @@ Html({
 
 say "<h1>Shell compatibility</h1>\n";
 
-my $data = do 'shell.inc.pl' or die $@ || $!;
+my $data = Data('shell');
 my @agents = keys %{ $data->{agents} };
 
 print '<table class="mapped">';
@@ -22,8 +22,13 @@ my $header = join('',
        '<tr>',
        '<th>feature',
        (map {
-               sprintf('<th>%s', Entity($_->{name}))
-       } @{ $data->{agents} }{@agents}),
+               sprintf('<th%s>%s',
+                       (map {
+                               sprintf ' title="%s"', Entity($_)
+                       } $data->{agents}->{$_}->{name} // ()),
+                       $_
+               )
+       } @agents),
 );
 print '<thead>', $header;
 say '</thead>';
@@ -34,32 +39,36 @@ sub saytitlecol {
        print '<td>', 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('<td class="%s" title="%s">%s',
-               join(' ',
-                       X => $CSTATS{$stat},
-               ),
+               join(' ', X => $level),
                $title,
-               $stat,
+               $TSTATS{$level} // (ref $support ? '?' : $support),
        );
 }