Merge branch 'master' of codeberg.org:night0721/lcc

This commit is contained in:
Night Kaly 2024-05-19 17:03:13 +01:00
commit 93708a9df6
Signed by: night0721
GPG key ID: 957D67B8DB7A119B
2 changed files with 11 additions and 1 deletions

View file

@ -20,6 +20,16 @@ $ make
# make install # make install
``` ```
# Customizing
You can modify `lcc.h` to add more languages to count lines, with the same format as provided in the file.
You can also add directories name and file extensions to ignore when counting lines, but the length of `ignore_dir` must be matching `IGNORE_DIRS`.
# Warning
Result may not be 100% correct due to coding style, but from testing, code with [suckless coding style](https://suckless.org/coding_style) will be most accurate due to different method of commenting in code.
# Contributions # Contributions
Contributions are welcomed, feel free to open a pull request. Contributions are welcomed, feel free to open a pull request.

2
lcc.c
View file

@ -93,7 +93,7 @@ void process_directory(const char *dirname)
for (int i = 0; i < IGNORE_DIRS; i++) { for (int i = 0; i < IGNORE_DIRS; i++) {
if (strstr(entry->d_name, ignore_dir[i]) != NULL) { if (strstr(entry->d_name, ignore_dir[i]) != NULL) {
skip = 1; skip = 1;
continue; break;
} }
} }
if (skip) continue; if (skip) continue;