ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/macros/doc/addDesc.sh
Revision: 1.1
Committed: Thu Jul 16 13:13:55 2009 UTC (15 years, 9 months ago) by loizides
Content type: application/x-sh
Branch: MAIN
Log Message:
First version of make htlm docu

File Contents

# User Rev Content
1 loizides 1.1 #!/bin/bash
2    
3     hf=$1
4     sf=`dirname $hf`/`basename $hf .h`.cc
5     sf=`echo $sf | replace interface src`
6     strs="//------------------------------"
7     lnum=`grep -n $strs $hf | cut -d: -f1 | head -n2 | tail -n1`
8    
9     if test -z $lnum; then
10     echo "Did not find header description, exiting."
11     exit 123;
12     fi
13    
14    
15     echo $lnum
16     head -n$lnum $hf > ${sf}.tmp
17     cat $sf | grep -v "// \$Id:" >> ${sf}.tmp
18     mv ${sf} ${sf}.keep
19     mv ${sf}.tmp $sf
20     exit 1;
21    
22     maxlnum=`grep -n ClassImp $sf | cut -d: -f1`
23     f1num=`grep -n $strs $sf | cut -d: -f1 | head -n1 | tail -n1`
24     f2num=`grep -n $strs $sf | cut -d: -f1 | head -n2 | tail -n1`
25    
26     if test -z $maxlnum; then
27     echo "Did not find ClassImp in source file, exiting."
28     exit 123;
29     fi
30    
31     if test $maxlnum -gt 0; then
32     maxlnum=`expr $maxlnum - 1`
33     fi
34    
35     if test $f1num -gt 0; then
36     f1num=`expr $f1num - 1`
37     fi
38     if test $f2num -gt 0; then
39     f2num=`expr $f2num + 1`
40     fi
41    
42     echo $maxlnum $f1num - $f2num
43    
44     tlnum=`wc -l $sf`
45     echo test $tlnum
46     expr $tlnum - $lnum
47    
48     if test $f1num -gt $maxlnum; then
49     echo "->>>>>>>>>>>>>>>>>> $fnum"
50     head -n$maxlnum $sf
51     head -n$lnum $hf | grep -v "// \$Id:"
52     tail -n$fnum $sf
53     else
54     echo "dooo";
55     fi