Counts the number of files, lines, lines of code (LOC) and bytes for a single file or a directory, grouped by file extension.
locr is a cross-platform .NET 8 console application.
locr [path] [options]
If no path is supplied, the current directory is analysed.
| Argument | Description |
|---|---|
path |
Path to a file or directory to analyse. Defaults to the current directory. |
| Option | Description |
|---|---|
-p, --path <path> |
Path to a file or directory to analyse. |
-m, --match <regex> |
Only files matched by the supplied regular expression will be scanned. |
-i, --include <pattern> |
Only include files that pass the wildcard search, e.g. *.cs |
-d, --matchdir <regex> |
Only directories matched by the supplied regular expression will be scanned. |
-v, --verbosity <level> |
Output verbosity level. 0=None, 1=Chatty Neighbor, 2=Gossip Columnist. Default is 0. |
-r, --recurse |
Recurse subfolders contained in the provided path. |
-h, --help |
Show help information. |
Options may be supplied as --name value or --name=value.
>locr .\src -r
locr 0.3.0.0
----------------------------------------------------------------------------------------------------
Scanning: .\src
Directories:40
Files:222 (Scanned:221, Ignored:1)
221 files scanned in 119ms, (1857 files/sec)
----------------------------------------------------------------------------------------------------
Extension Files Lines LOC Bytes
.cs 11 811 609 28,687
.csproj 2 42 32 1,327
.json 12 2,894 2,874 144,628
.sln 1 29 26 1,458
...
----------------------------------------------------------------------------------------------------
Total: 222 4,718 4,447 8,188,500
----------------------------------------------------------------------------------------------------
Requires the .NET 8 SDK.
dotnet build src/locr.sln -c Release
dotnet test src/locr.sln -c Release
dotnet run --project src/locr -c Release -- [path] [options]