From e6f9791973f7c1ef542c3b1438b7fb0527f22109 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Fri, 6 Sep 2019 22:54:05 +0200 Subject: [PATCH] cli: frontend page listing commandline parameters --- cli.plp | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 cli.plp diff --git a/cli.plp b/cli.plp new file mode 100644 index 0000000..d8653e8 --- /dev/null +++ b/cli.plp @@ -0,0 +1,61 @@ +<(common.inc.plp)><: + +Html({ + title => 'cli cheat sheet', + version => '1.0', + description => [], + keywords => [qw' + '], + data => ['data/cli.inc.pl'], +}); + +my $cmd = do 'data/cli.inc.pl' + or Abort("Error loading program data", 501, $@ // $!); +:> +

CLI options

+ + +<: +sub showoption { + my ($info, $char, $span) = @_; + my ($alias, $help) = @{ $info // [] }; + printf ''; + $info or return; + my ($title) = $alias =~ m{--([\w-]+=?)} + or return print $char; + $title =~ s/-\K//g; + $title =~ s/deref\Kerence/./; + print $title; +} + +my @colchars = ('a'..'z', '?'); +print ''; +print qq'' for scalar @colchars; +#say ''; +for my $section (qw{thead tfoot}) { + print "<$section>'; +for my $name (sort keys %$cmd) { + my $row = $cmd->{$name}; + print '"; + $row->{$_} and showoption($row->{$_}, $_) for map {uc} @colchars; +} +say '
↳"; + print '', EscapeHTML($_) for @colchars; + say ''; +} +print '
', $name; + showoption($row->{$_}, $_, !$row->{uc $_}) for @colchars; + print "\n\t
'; +:> + +
+ +
supported + unsupported + alias +
+
-- 2.30.0