Lightweight and versatile command-line tool designed to simplify
counting source lines of code.
Whether you're a developer reviewing codebases, a project manager
tracking progress, or simply curious about code metrics, LexaCount
provides an efficient way to analyze and understand the structure of
your source code with various options that adapt to your needs.
Screenshot of LexaCount with command line
lexacount -l lexacount.lst -b -t
lexacount [-b] [-t] [-x] [-l <list file 1>] [-l <list file
2>] ... [file1] [file2] ...
-
-b, --bracket
Do not count lines containing only brackets or parentheses
-
-h, --help
Display this help menu
-
-l, --list
Load file names from a file
-
-t, --table
Print the output using tables
-
-v, --version
Display program version
-
-x, --exclude
Exclude files inside lists if they cannot be read; do not give error
messages
-
lexacount main.c main.h
Counts the lines of code of files main.c and
main.h
-
lexacount -l file_names.list -t
Counts the lines of all file names inside
file_names.list in table format
-
lexacount -l file_names.list include/header.h -b
Counts the lines of all file names inside
file_names.list and include/header.h,
excluding all lines containing only brackets
Using a list file is a beneficial addition to LexaCount, allowing for
the automation of counting lines in a large codebase with unlimited
files. The list file should contain file names separated by newlines,
with each line representing a single file. For example, a list file
named
lines.list would look like this:
src/include/main.h
src/include/input.h
src/main.c
src/input.c
make.sh
website/index.html
By calling
lexacount -l lines.list, LexaCount will count
the lines of code for the files listed inside
lines.list and not the lines of the list file itself.
This command loads file names from
lines.list and counts
the lines for each specified file, streamlining the process of
analyzing multiple files.
LexaCount has been written in standard C99 without making use of any
platform-specific libraries. This makes LexaCount compatible with
Windows, Linux, and Mac.
If you found a bug or want to add a new feature, don't hesitate to
create a
pull request
or an
issue!
Contributions are greatly appreciated.
LexaCount is distributed under the GNU GPL v3.0 license. See the
LICENSE
file for details.