aboutsummaryrefslogtreecommitdiff
path: root/shunit2-2.0.3/bin/extractDocs.pl
diff options
context:
space:
mode:
authorPeter Carbonetto2017-07-18 12:56:21 -0500
committerPeter Carbonetto2017-07-18 12:56:21 -0500
commit66e2499abdeb663034721425ad6e8efb3340ad99 (patch)
tree488cd3c971985fcc66579539e2704bb2641aadc4 /shunit2-2.0.3/bin/extractDocs.pl
parent9c718e1730ffdc78a9154f227250799ab52f7dfa (diff)
downloadpangemma-66e2499abdeb663034721425ad6e8efb3340ad99.tar.gz
Added shunint2 v2.0.3 files.
Diffstat (limited to 'shunit2-2.0.3/bin/extractDocs.pl')
-rwxr-xr-xshunit2-2.0.3/bin/extractDocs.pl40
1 files changed, 40 insertions, 0 deletions
diff --git a/shunit2-2.0.3/bin/extractDocs.pl b/shunit2-2.0.3/bin/extractDocs.pl
new file mode 100755
index 0000000..a803526
--- /dev/null
+++ b/shunit2-2.0.3/bin/extractDocs.pl
@@ -0,0 +1,40 @@
+#! /usr/bin/perl
+# $Id$
+
+if(@ARGV != 1) {
+ print "usage: $0 sourceFile\n";
+ exit;
+}
+
+$sourceFile = $ARGV[0];
+
+#
+# read in the source file
+#
+$rslt = open(FILE, $sourceFile)
+ || die "could not open file ($sourceFile)";
+
+$inComment = 0;
+while(<FILE>) {
+ next if /^[^#]/;
+ s/^# //;
+ s/^#//;
+
+ if(/^\/\*\*/) {
+ $inComment = 1;
+ next;
+ }
+ if(/\*\/$/) {
+ $inComment = 0;
+ next;
+ }
+
+ if ($inComment == 1) { print $_ };
+ if ($inComment == 0 && /\/\/\*/) {
+ @line = split /\/\/\*/, $_, 2;
+ $line[1] =~ s/^ //;
+ print $line[1];
+ }
+}
+
+close(FILE);