1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-23 06:03:09 +02:00
ben-wpan/prod/doc/figfilt
Werner Almesberger 5733b60721 prod/doc/figfilt: script to filter portions of a FIG file based on keys in comments
This file is part of the production documentation build process but was
never committed.
2013-01-30 10:13:14 -03:00

19 lines
262 B
Perl
Executable File

#!/usr/bin/perl
$key = shift @ARGV;
$skip = 0;
$skipping = 0;
while (<>) {
if (/^#/ && $. != 1) {
$skip = $_ !~ /$key/;
print unless $skip;
next;
}
if (/^\s/) {
print unless $skipping;
next;
}
print unless $skip;
$skipping = $skip;
$skip = 0;
}