Proposal: Support ignore all subdirectories by a single option.
Hello, thanks for the tools. So far I've found that, by default, when you supply a directory, the tool counts the code in that directory and all its subdirectories. But sometimes, I just want to count the current directory, not the subdirectories. I took a quick look and there doesn't seem to be a single such option. If the --exclude parameter is used, it is troublesome when there are many subdirectories. I wish it could provide an option to ignore all subdirectories. Thank you!
If the maintainers are in support of this, I am willing to try my hand at implementing this.
An approach mentioned back in #676 was that we could support a wider range of use cases by allowing Tokei to optionally take a file list from stdin, which would then let it be piped into with find. Taking the proposed syntax from there, traversing a directory for files non-recursively would be done with something like find . -maxdepth 1 -type f | tokei -.
Thank you! Yes, find . -maxdepth 1 -type f | tokei - is a good way to do it.
However, I actually wrote a piece of Go code to invoke this tool. This way of writing increases the complexity of writing code. That's why I had this idea. I hope you'll think about it again. Thank you.