XAMPPRocky / tokei

Count your code, quickly.
Other
11.35k stars 542 forks source link

Glob path with * as input #871

Open realmofevil opened 2 years ago

realmofevil commented 2 years ago

Hello, I was comparing features between https://github.com/XAMPPRocky/tokei/ and https://github.com/AlDanial/cloc I find they have minor count differences in the results but tokei seems to be much faster and works great, so I like it better. But there is one difference in functionality that cloc has and is very important for my use case, maybe for others as well.

Directory structure example:

\Project\Content
├───Name1
│   ├───Code
│   │   └───ClassDefs
│   └───Presets
│       ├───Preset
│       ├───Other
│       └───Templates
├───Name2
│   ├───Code
│   ├───Presets
│   │   ├───Config
│   │   └───Templates
│   └───etc
*

In cloc you can count only the code in all sub-directories that have the folder Code in the end path:

cloc Project/Content/*/Code

This doesn't seem to be possible with tokei at the moment or I have no idea how to achieve it. Currently you have to go and list by hand every dir or achieve it by additional scripting which is not ideal.

Note: Part of my real problem is that all files in the other sub-directories like Presets, etc. are with source file extensions e.g., ".lua" in my case but they actually don't contain any actual code logic, so I want to filter only the results from the Code dirs.

svercl commented 2 years ago

I think this could be achieved by using globs for the input paths