--On Friday, January 27, 2006 1:44 PM -1000 "(Cedric) Qin ZHANG" <[EMAIL PROTECTED]>
wrote:
This is related to how sclc determine a file type. It not only looks at file
name
extension, but also checks file content (which is especially important for
perl, bash,
etc. scripts). It's not a bug of sclc. It did what it supposed to do: computing
all the
files recursively in a directory.
What we need to do is to find a way to tell it to exclude files in .svn folder.
I am
thinking about an "exclude" switch:
-exclude regexForFileNames
Whenever the file name matches the regular expression, the file is excluded. My
perl is
rusty, I am not sure whether this is the best option or not.
My question is:
(1) Do we absolutely need this feature?
Unfortunately, I think the answer to this is Yes. I don't think anyone would want to
have the set of scripts found in a .svn project "count" as part of their software system
under development.
(2) Is there a better alternative than an "exclude" switch and a regular
expression?
Well, in the Ant world, there is the notion of "defaultExcludes":
**/*~
**/#*#
**/.#*
**/%*%
**/._*
**/CVS
**/CVS/**
**/.cvsignore
**/SCCS
**/SCCS/**
**/vssver.scc
**/.svn
**/.svn/**
**/.DS_Store
One approach would be to have SCLC not traverse these directories or count these files by
default. This would take care of a lot of situations automatically, but if we go this
way, then we need a way to modify/override the default settings. One way to do this
would be to have two switches:
-exclude (indicates additional exclusions beyond the defaults)
-nodefaultexcludes (indicates don't use the default exclusions; whatever you want has to
be on the -exclude switch)
There are some Perl links that might help with this task:
<http://search.cpan.org/~ivorw/File-Wildcard-0.07/lib/File/Wildcard.pm>
<http://phy.duke.edu/~schol/sk_intro/rfwildcard_howto.html>
<http://builder.com.com/5100-6375-5109994.html>
Cheers,
Philip