changeset 1492:658986e62c49

* Initial entry into CVS once I discovered that steve is also using minchistory.
author rotor <rotor>
date Wed, 04 Dec 2002 05:06:04 +0000
parents 2ebe7bccb583
children ff19627bc377
files progs/minchistory/minchistory
diffstat 1 files changed, 47 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
new file mode 100755
--- /dev/null
+++ b/progs/minchistory/minchistory
@@ -0,0 +1,47 @@
+#! /usr/bin/env perl
+#
+# Andrew Janke - rotor@cmr.uq.edu.au
+# Simple script to dump history information from a minc file
+#
+# Thu Feb  3 14:00:26 EST 2000 - initial version
+# Wed Oct 18 10:01:17 EST 2000 - rewrite and removed -clobber ommision
+# Tue Dec  3 23:38:15 EST 2002 - rewritten to pretty-print entries <smr>
+# Tue Dec  3 08:25:23 EST 2002 - shifted to CVS
+
+
+use strict;
+use warnings "all";
+use Text::Format;
+use File::Basename;
+
+my($Usage, $me, $text, $fname, $counter);
+
+$me = &basename($0);
+$Usage = "Usage: $me <file1.mnc> [<file2.mnc> ... ]\n\n";
+die $Usage if ($#ARGV < 0);
+
+# set up text object
+$text = new Text::Format( firstIndent => 0,
+                          bodyIndent => 5,
+                          columns => 78 );
+
+# for each input file
+foreach $fname (@ARGV){
+   if(!-e $fname){
+      warn "$me: Couldn't find $fname\n";
+      next;
+      }
+
+   print "--- History of $fname ---\n";
+
+   $counter = 1;
+   foreach (`mincinfo -attvalue :history $fname`){
+      chomp;
+      next if $_ eq '';
+      
+      printf "[%02d] ", $counter ++;
+      print $text->format($_);
+      }
+   print "\n";
+   }
+