Documentation ¶
Overview ¶
'countula' is a command-line tool designed to count lines of code in files across a directory tree, allowing for granular control over which files are included or excluded from the count.
Flags:
-root: Sets the root directory from which to start traversal. If not specified, 'countula' defaults to the current working directory. -include: Specifies a comma-separated list of glob patterns to include in the traversal. Only files matching at least one of these patterns are considered for counting. If no includes are provided, everything except explicitly excluded patterns is included. -exclude: Specifies a comma-separated list of glob patterns to exclude from the traversal. Any file matching at least one of these patterns is ignored. -out: Determines the destination for the output report. Users can specify a file path to direct the output to a file, or leave this flag unspecified to default the output to standard output. -ignore-prefix: Specifies line prefixes that trigger skipping the line, useful for ignoring comments or specific code patterns. -dir-mode: When set, the output groups counts by directory. -merge-mode: When set, the output does not split counts by file extension, merging them into a single count per directory or globally.
Example Usage:
$ countula -root "./source" -out "count_report.txt" -include "*.go,*.json,*.md" -exclude ".git" -ignore-prefix "//,#" -dir-mode
Click to show internal directories.
Click to hide internal directories.