+bin/cherry* for Jenkins.
[nethome.git] / bin / cherryfilter
diff --git a/bin/cherryfilter b/bin/cherryfilter
new file mode 100755 (executable)
index 0000000..681a0e1
--- /dev/null
@@ -0,0 +1,20 @@
+#! /usr/bin/perl
+use strict;
+use warnings;
+my $file;
+while (<STDIN>) {
+  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;
+}