英文:
Cloc check files that include text
问题
Cloc 有一种方法可以使用 --exclude-content=<regex> 来排除包含特定文本的文件。我正在寻找一种方法来执行相反的操作。如何检查仅包含特定短语的文件?我尝试过 cloc . --exclude-content='/^((?!import).)*$/s' 但它没有提供所需的结果。我还尝试过使用 --ignored 来编写一个被忽略的文件,但那只提供了被忽略的原因,而不是行数。
我应该如何只包括包含文本的文件?
英文:
Cloc has a way to exclude files that contain text using --exclude-content=<regex>. I’m looking for a way to do the opposite. How can I check files that only include certain phrases? I've tried cloc . --exclude-content='/^((?!import).)*$/s' but it doesn't give the desired results. I have also tried writing an ignored file using --ignored but that only gives the ignored reason, and not the line count.
How would I be able go about only including files that contain text?
答案1
得分: 0
这已经添加到 cloc。
英文:
This was added to cloc.
cloc-master/./cloc ../Folder --include-content="import Nimble" --by-file-by-lang --quiet > QuickAndNimbleFiles.txt
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论