0

我只需要从某些特定目录/子目录中排除 *.c 文件。这可能吗?

4

1 回答 1

0

cloc 没有内置的方法来做到这一点。您可以排除所有 *.c,或排除特定的 dir/subdir,但不能仅在 dir/subdir 内排除 *.c。

想到一个两步解决方案:您可以制作一个要排除的文件列表,然后将该列表文件传递给 cloc --exclude-list-file,例如,

    find dir/subdir -type f -name "*.c" > dont_want_these.txt
    cloc --exclude-list-file dont_want_these.txt dir
于 2018-02-23T18:54:41.123 回答