aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-20 20:52:14 +0000
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-20 20:52:14 +0000
commite666807a6ffc592be03dddb90ad2d40f2011c8d6 (patch)
tree78acf5fa5de12204ebbc42a67c9b9691f2f27cb8 /tools
parent8686a33807ff0e2207a5f574ef56de085bd14ef3 (diff)
downloadriscv-openocd-e666807a6ffc592be03dddb90ad2d40f2011c8d6.zip
riscv-openocd-e666807a6ffc592be03dddb90ad2d40f2011c8d6.tar.gz
riscv-openocd-e666807a6ffc592be03dddb90ad2d40f2011c8d6.tar.bz2
Add 'docs' and 'doxygen' targets to top-level Makefile.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1858 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'tools')
-rw-r--r--tools/logger.pl34
1 files changed, 34 insertions, 0 deletions
diff --git a/tools/logger.pl b/tools/logger.pl
new file mode 100644
index 0000000..1ec5441
--- /dev/null
+++ b/tools/logger.pl
@@ -0,0 +1,34 @@
+#!/usr/bin/perl
+# logger.pl: masks long meaningless output with pretty lines of dots
+# Details: 1) reads lines from STDIN and echos them on STDOUT,
+# 2) print a '.' to STDERR every $N lines.
+# 3) print a newline after a sequence of $C dots
+
+use strict;
+use warnings;
+
+# make sure all output gets displayed immediately
+$| = 1;
+
+# TODO: add -n and -c options w/ zero checks)
+# line and column limits
+my $N = 10;
+my $C = 72;
+
+# current line and column counters
+my $n = 0;
+my $c = 0;
+
+# read all lines from STDIN
+while (<STDIN>)
+{
+ # echo line to output
+ print STDOUT $_;
+ # only display progress every Nth step
+ next unless ++$n % $N;
+ print STDERR ".";
+ # wrap at column C to provide fixed-width rows of dots
+ print STDERR "\n" unless ++$c % $C;
+}
+
+print STDERR "\n"