Skip to content

Allow --sum-report to take filenames from a file #914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ericfrederich opened this issue May 13, 2025 · 2 comments
Closed

Allow --sum-report to take filenames from a file #914

ericfrederich opened this issue May 13, 2025 · 2 comments

Comments

@ericfrederich
Copy link

I generate reports and store them inside of each Git repo under .git/reports/cloc.
For a small amount of reports I'm able to do the following.

cloc --sum-report $(find ~/src -path "*/.git/reports/cloc")

But Linux/Bash has its limitations and with thousands of projects this doesn't work.

Suggestion

Add a new option --sum-report-file. Then I should be able to get a summary by doing the following:

find ~/src -path "*/.git/reports/cloc" > /tmp/all_reports
cloc --sum-report-file /tmp/all_reports
@AlDanial
Copy link
Owner

Oddly enough, cloc can already do this. The trick is to use the --vcs switch. Although --vcs was designed to support versioning tools like git, svn, etc, it will work with any command that returns a list of files. Therefore you just need to do

cloc --vcs="cat /tmp/all_reports" --sum-reports

@AlDanial
Copy link
Owner

--vcs was not an obvious solution; to help others find this capability I added --files-from as a synonym to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants