Skip to content
This repository has been archived by the owner on Oct 6, 2024. It is now read-only.
/ loc Public archive

[Feature complete] Simple C code line counter

License

Notifications You must be signed in to change notification settings

maandree/loc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repo has been moved to Codeberg and may be out of date on GitHub.
Canonical repo: https://codeberg.org/maandree/loc


NAME
	loc - count number of lines of code

SYNOPSIS
	loc [-s] [file] ...

DESCRIPTION
	loc counts the number of lines of code for each specified
	file. loc will treat each file as a C source code or C header
	file. If file is -, or if a file is not specified, the
	standard input is read.

	If more than one file is specified, each successfully
	line counted file will have its of lines of code output on
	the format

		"%s:%*s%zu\n", <file>, <some positive integer>, "", <#lines of code>

	The total for all processed files, is printed on the last
	line with the format

		"%zu\n", <#total lines of code>

	If exactly one or no files are specified, this will be the
	only line output.

OPTIONS
	-s
		Only output the last line. (The total over all files.)