CLOC - how to count loc in a specific (unique) directory using match-d

1.1k views Asked by At

I need to count lines of code in a specific directory named 'gen' and I cannot just hard code the path to this directory because it can be anywhere inside a root directory (the path is variable). Would be possible to use match-d? I don't want however to include all directories that contain 'gen', therefore this will not work:

--match-d = 'gen'

Thanks.

1

There are 1 answers

0
AlDanial On BEST ANSWER

Use a combination of --fullpath (to let the filter apply to the entire directory path instead of just the trailing directory name) and positive or negative look-aheads in --match-d to isolate the /gen/ subdirectory of interest.

If you post a sample directory structure you're working with and identify the directories you want and don't want, I will take a shot at writing a --match-d expression to meet your needs.