Menu

#8 Difference btw --not-match-d and --exclude-dir

v1.61
closed
nobody
None
1
2015-06-27
2014-03-28
Anonymous
No

Would you please explain the use of --not-match-d and --exclude-dir? What is the difference btw these two options?

I arrange my folder structure as following:
D:\X\A1\ D:\X\A2\ In each folder A1 and A2, I have three more subfolders as follow:
D:\X\A1\source
D:\X\A1\doc
D:\X\A1\review
D:\X\A2\source
D:\X\A2\doc
D:\X\A2\review
If I want to count files in "source" folder only, how can I use the the options --match-d and --exclude-dir?

Thank you.

If I want to count the

Discussion

  • Al Danial

    Al Danial - 2014-03-28

    --not-match-d accepts Perl regular expressions while --exclude-dir works with literal directory names. But you're right, the two are nearly identical. --exclude-dir was implemented first, but --not-match-d can do everything that --exclude-dir can and more.

    To only count files in your 'source' folders, do

    D:> cloc --match-d "source" X
    
     
  • Al Danial

    Al Danial - 2014-03-28
    • status: open --> pending
     
  • Al Danial

    Al Danial - 2015-06-27
    • status: pending --> closed
     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.