https://github.com/aliosm/lines-counter
Count the number of lines in directory tree with specific files extensions
https://github.com/aliosm/lines-counter
line-counter tool
Last synced: 10 months ago
JSON representation
Count the number of lines in directory tree with specific files extensions
- Host: GitHub
- URL: https://github.com/aliosm/lines-counter
- Owner: AliOsm
- License: mit
- Created: 2018-08-28T20:17:29.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-30T10:06:15.000Z (over 7 years ago)
- Last Synced: 2025-07-01T21:11:46.400Z (12 months ago)
- Topics: line-counter, tool
- Language: C++
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lines-counter
Count the number of lines in directory tree with specific files extensions
## Why?
I was trying to count how many lines I've written while solving competitive programming problems.
## How to use it?
- Compile `main.cpp` file with `gcc` or any other compiler.
- Run the executable file with `FILE_NAME PATH EXT [EXT [EXT [...]]]`.
- `PATH` should be a directory path.
- `EXT` should be any file extension (without the dot `.`).
Example run:
```
$ g++ main.cpp -o main
$ ./main /home/aliosm/Repositories/CompetitiveProgramming cpp java
cpp extension:
Number of files: 1101
Number of lines: 47863
java extension:
Number of files: 1
Number of lines: 21
Total number of files is 1102
Total number of lines is 47884
```
## How it works?
When you run the compiled file and give it the `PATH` argument with some `EXT`'s, the code will open the directory in `PATH` and using `BFS` algorithm, it will try to reach all files that end with any `EXT` in the current directory and all other directories inside it.
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/AliOsm/lines-counter.
## License
The project is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).