bump versions of all pages with visible changes since v1.11
[sheet.git] / cli.plp
1 <(common.inc.plp)><:
2
3 Html({
4         title => 'cli cheat sheet',
5         version => '1.0',
6         description => [],
7         keywords => [qw'
8         '],
9         data => ['data/cli.inc.pl'],
10 });
11
12 my $cmd = do 'data/cli.inc.pl'
13         or Abort("Error loading program data", 501, $@ // $!);
14 :>
15 <h1>CLI options</h1>
16
17 <style>
18         tbody td {font-size:70%}
19 </style>
20 <:
21 sub showoption {
22         my ($info, $char, $span) = @_;
23         my ($alias, $help) = @{ $info // [] };
24         printf '<td class="l%s"', $info ? 5 : 1;
25         print ' rowspan="2"' if $span;
26         print '>';
27         $info or return;
28         my ($title) = $alias =~ m{--([\w-]+=?)}
29                 or return print $char;
30         $title =~ s/-\K/<wbr>/g;
31         $title =~ s/deref\Kerence/./;
32         print $title;
33 }
34
35 my @colchars = ('a'..'z', '?');
36 print '<table class="ccmap"><col>';
37 print qq'<colgroup span="$_">' for scalar @colchars;
38 #say '</colgroup><col>';
39 for my $section (qw{thead tfoot}) {
40         print "<$section><tr><th>↳";
41         print '<th>', EscapeHTML($_) for @colchars;
42         say '';
43 }
44 print '<tbody>';
45 for my $name (sort keys %$cmd) {
46         my $row = $cmd->{$name};
47         print '<tr><th rowspan="2">', $name;
48         showoption($row->{$_}, $_, !$row->{uc $_}) for @colchars;
49         print "\n\t<tr>";
50         $row->{$_} and showoption($row->{$_}, $_) for map {uc} @colchars;
51 }
52 say '</table>';
53 :>
54
55 <div class="legend">
56         <table class="glyphs"><tr>
57         <td class="X l5">supported
58         <td class="X l1">unsupported
59         <td class="X l0 ex">alias
60         </table>
61 </div>