shell: translate support letters to annotated levels
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 11 Jun 2018 19:37:01 +0000 (21:37 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 11 Jun 2018 20:12:17 +0000 (22:12 +0200)
commit1f5d573b18e45cff4db6fc90f0663d2096f189cf
treed3c4dbbecc0c82e27a2678cc1eceb8ff83523ced
parenta552717b456a77062808b59fbecfe58a5d4e84df
shell: translate support letters to annotated levels

Reparse usenet data to extended metadata hashes:

perl -MData::Dumper=Dumper -MList::MoreUtils=mesh -wE'
while (<>) { last if s/^ +// }
my @cols = split /\s+/;
my %level = (
Y => {}, N => undef, F => {alt => "function"}, L => {optional => "requires readline"},
"Y(1)" => {since => 0},
"Y(2)" => {since => undef},
"Y(3)" => {partial => 1, note => "emulation is thought by many to be incomplete"},
"N(4)" => {alt => "patch", note => "unofficial patches exist to perform this"},
"N(5)" => {alt => "patch", note => "A version called \47pdksh\47 is freely available, but does not have the full functionality of the AT&T version."},
"N(6)" => {alt => "function", note => "This can be done via the shells programmable completion mechanism."},
"Y(7)" => {alt => "config", note => "Only by specifying a file via the ENV environment variable."},
);
while (<>) {
chomp; $_ or last;
my ($title, $support) = split /  +/, $_, 2;
my @support = map { exists $level{$_} ? $level{$_} : $_ } split / +/, $support;
push @data, { title => $title, support => { mesh(@cols, @support) } };
}
print Data::Dumper->new([\@data], ["feature"])
->Deepcopy(1)->Indent(1)->Quotekeys(0)->Sortkeys(1)->Trailingcomma(1)
->Dump;
' todo/shell.inc.txt >shell.inc.pl
shell.inc.pl
shell.plp