XAMPPRocky / tokei

Count your code, quickly.
Other
10.88k stars 527 forks source link

[Feature Request] Ability to count file as specific language #714

Open benstigsen opened 3 years ago

benstigsen commented 3 years ago

The ability to count a custom file with a specific language would be nice. This would also make tokei support custom languages, many similar languages and other types of custom files the user might make.

Currently I'd like to count a .wren file as C code, but I'm only able to do that if I first change the extension of the file which can be messy over multiple files. So ability to count custom file types and/or filenames with a specific syntax.

matu3ba commented 2 years ago

@BenStigsen Is there a reason, why you cant recursively search for file endings with fd and rename them or keep a separate list and use a shell script to count them and rename them back with mv? fd even support convenient ignorelists (with .gitignore syntax).

See my dotfiles example for inspirations how to do it.

benstigsen commented 2 years ago

This does not sound like a good solution. It shouldn't be necessary for me to rename a list of files, especially in big projects, then run Tokei, then rename the files again. It'd make much more sense if I could just do something like tokei --language=c *.wren.

ice1000 commented 2 years ago

I second this