countcode(1)

πŸ’– countcode(1) πŸ’–

okay bestie, so this is the manual page for countcode, straight out of the General Commands Manual, and I need you to know that this little icon is lowkey a whole vibe. it counts your source lines. per file type. periodt. ✨


🌸 NAME 🌸

countcode β€” counts per known source file type the number of source lines

no fr, that's it, that's the whole job 🫢


πŸŽ€ SYNOPSIS πŸŽ€

countcode [-h] [-b] [-c] [-s] [-l] [-p PRINTLEVEL] [-d] [-t] [-v]
[directory]

πŸ’… DESCRIPTION πŸ’…

so countcode counts, per known source file type, the number of source lines in the files in the given directory and recursively in all its subdirectories. it supports many file types, like genuinely a lot of them. the type gets recognized from the file name extension or from the shebang script type. use -s to see all the supported types πŸ‘‘

here's the tea on which line types get counted:

  • code: β€” pure code lines
  • comment: β€” pure comment lines
  • blank: β€” empty lines, or lines that are nothing but whitespace
  • header: β€” the copyright header (aka the leading comment lines)
  • other: β€” literally everything else
unless you pass -b, a pure code or comment line has to contain an alphanumeric character. so like, a lonely little } by itself? not a code line. sorry bestie, rules are rules πŸ’€

it calculates the percentage of code and comment lines in the total number of lines β€” or, if -l is given, in the sum of code and comment lines. unless -t is given, files in test directories get counted separately. normal output goes on stdout; verbose output goes on stderr. files with an unknown type get reported on stderr. and ngl, note that -bt should give you about the same results as a tool like cloc 🌈


πŸ¦‹ positional arguments πŸ¦‹

  • directory β€” name of top directory to count source files (default is .)

✨ optional arguments ✨

  • -h, --help β€” show this help message and exit
  • -b, --basic β€” count copyright header and lines without an alphanumeric character as code/comment lines
  • -c, --code β€” only use source files containing code (e.g. no .parset)
  • -s, --sum β€” only calculate and print the sum of all file types
  • -l, --limitperc β€” limit to the nr of code and comment lines to determine percentages
  • -p PRINTLEVEL, --printlevel PRINTLEVEL β€” first directory level to print (default 0 (=top))
  • -d, --displaytypes β€” display the currently recognized file types (full info with -v)
  • -t, --testinclude β€” do not count test directories separately
  • -v, --verbose β€” print count for each source file

🌟 AUTHOR 🌟

this manual page was written with the help of help2man by Benda Xu <heroxbd@gentoo.org>, for the Debian GNU/Linux system. iconic of them honestly 🫢


and that's the whole page, bestie!! this version came from caascore and it's dated 2016-03-25 β€” go forth and count some code, mwah πŸ’‹πŸŽ€