X-Git-Url: http://git.jankratochvil.net/?p=nethome.git;a=blobdiff_plain;f=bin%2Fcherryfilter;fp=bin%2Fcherryfilter;h=681a0e15995a6ea08729e9177e024fc4223180dc;hp=0000000000000000000000000000000000000000;hb=43ea3d5a4c057b1e84fe32d44ede7e6c34033fec;hpb=a582872252d3bf623d1e49a7c8dfd4fa910468ce diff --git a/bin/cherryfilter b/bin/cherryfilter new file mode 100755 index 0000000..681a0e1 --- /dev/null +++ b/bin/cherryfilter @@ -0,0 +1,20 @@ +#! /usr/bin/perl +use strict; +use warnings; +my $file; +while () { + if (/^[^+-]/) { + $file=$_; + next; + } + my $match; + for my $arg (@ARGV) { + $match=1 if /\Q$arg\E/; + } + next if !$match; + if (defined $file) { + print $file; + $file=undef; + } + print; +}