~ubuntu-branches/ubuntu/quantal/pmccabe/quantal

« back to all changes in this revision

Viewing changes to vifn

  • Committer: Bazaar Package Importer
  • Author(s): Paul Bame
  • Date: 2003-03-12 14:05:33 UTC
  • Revision ID: james.westby@ubuntu.com-20030312140533-moud629bi4ryp48y
Tags: 2.2-3
tweek for running under buildd and whenever pmccabe not installed
and . not in $PATH

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
if [ $# = 0 ]
 
4
then
 
5
    echo "Usage: `basename $0` [filename/]functionname [...]" >&2
 
6
    exit 2
 
7
fi
 
8
 
 
9
exec 3<&0
 
10
 
 
11
while [ $# != 0 ]
 
12
do
 
13
    fname=`dirname "$1"`
 
14
    fn=`basename "$1"`
 
15
 
 
16
    if [ $fname = "." ]
 
17
    then
 
18
        if [ ! -f pmccabe.out ]
 
19
        then
 
20
            pmccabe *.[Cc] >pmccabe.out
 
21
        fi
 
22
 
 
23
        grep ": $fn$" pmccabe.out
 
24
 
 
25
    else
 
26
        pmccabe $fname | grep ": $fn"
 
27
    fi |
 
28
        sed 's/[()]/ /g' |
 
29
        while read c1 c2 statements l1 nl filename linenumber fnname
 
30
        do
 
31
            vi +$linenumber $filename <&3
 
32
        done
 
33
 
 
34
    shift
 
35
done