In a message dated: Tue, 05 Sep 2000 11:29:20 EDT
David Roberts said:

>Sorry for the interruption, but...
>
>Any idea if there is a open/share based SLOC (Source Lines Of
>Code) counter function?  I have a relatively new manager who
>came in from a MIL contractor and they eat/live/breath this
>kind of stuff (yup, I've been there already - and I totally
>pissed off one manager when I went and reduced the count on a
>project  ;)
>
>Anyway, I did a quick check of Linuxberg and a couple other
>sites, but no luck.  So, before I go out and write one I was
>wondering if anyone in the group knew of a counter already out
>there in Penguin land (script/rpm/compilable source, I really
>don't care at this point)...

Anything wrong with something like:

        grep -v '^\/\*' foo.c | grep -v '\*\/$' | grep -v '^ *$' | wc -l

Of course you may need to tailor it slightly here and there, but this
is exactly the point behind the whole "Unix Philosophy"...The sum of the whole 
is far greater than the parts.

(of course, emacs probable has this build in, too :)

When I was at Raytheon, someone there had written a tool called 'sloc' which 
was nothing more than a quite complicated shell script based around things like
awk, grep and wc.

Perl could quite easily accomplish the same thing.

Additionally, this may be a moot point, since you're dealing with a gov/defense
contractor mentality, you might want to point out that comments:

        a. take a lot of time to write
        b. are as important as the code they describe

and, therefore, should not be ignored/disregarded.  Especially since they 
actually *increase* the number the script would spit out :)
-- 
Seeya,
Paul
----
           I'm in shape, my shape just happens to be pear!

         If you're not having fun, you're not doing it right!



**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************

Reply via email to