cline

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
SHORTCUTS
EXAMPLES
SEE ALSO
AUTHOR

NAME

cline − count line terminator characters in files

SYNOPSIS

cline [Options] [Directories...]

DESCRIPTION

cline counts the line terminator characters (\n) within all files in the specified directories.

If no directory is specified, cline scans the current directory.

OPTIONS

−b level

Set the binary file heuristics level. The default is medium. Valid levels are: ignore, low, medium, and high. The heuristics use the ratio of non-printable characters after seeing enough printable characters in the file (see isprint(3)). The higher the detection level, the more printable characters the algorithm wants to see before making a decision.

Note that some Unicode files with a high ratio of non-printable characters from the perspective of isprint(3), might be misdetected by this algorithm as binary files.

−c

Count non-whitespace characters instead of lines.

−d

Report only directory sums.

−D path

Exclude the directory at the specified path. A path can be relative or absolute but must always contain at least one path separator. For example, if you want to exclude the top-level target directory in a project of yours, use −D ./target to specify a path relative to your current directory. If you just write −D target you would exclude all directories with that name in an recursive search with the -r option. This option may be used multiple times.

−D name

Exclude all directories with the given name. This option may be used multiple times.

−E pattern

Exclude any line matching the regular expression pattern. This option may be used multiple times.

−e start end

Exclude lines between the regular expressions start and end. The first and the last line are only excluded when they completely match the start or end pattern, respectively. Similarly, when used with the −c option, characters within a line before start matches and after end matches are still counted. This option may be used multiple times.

−h, −−help

Print help text and exit.

−i

Print individual sums per file extension. This option cannot be used together with −V.

−m

Print information about matching files only.

−s suffixes

Only count files with these suffixes. Suffixes are separated by commas.

−S suffixes

Count any file except those with these suffixes. Suffixes are separated by commas.

−r, −R

Scan subdirectories recursively.

−v, −−version

Print version information.

−V

Turn verbose output off and print the result only.

SHORTCUTS

−−exclude−cstyle−comments

Equivalent to: −E ’\s*//’ −e ’\s*/\*’ ’\*/\s*’

−−exclude−blank−lines

Equivalent to: −E ’ˆ\s*$’

EXAMPLES

cline −rms .c,.h −−exclude−cstyle−comments

Recursively count matching .c and .h files, print matching files only, and exclude C-style comments.

cline −Vc src

Print only the total number of non-whitespace characters in src.

cline −rms .rs −D ./target

Recursively count matching Rust source files starting with the current directory, but skip the target directory. Print only matching files.

cline −rb high -d -D .git

Recursively count all non-binary files with a high binary file detection heuristic. Report only sums per directory and skip all directories with the name .git.

SEE ALSO

https://uap-core.de/man/cline.html
https://uap-core.de/hg/cline
https://sourceforge.net/projects/cline/

AUTHOR

Copyright 2018 Mike Becker.