Here is a tool cloc for the number of lines of statistical code for a Mac system.
1, first, install homebrew, have installed please skip.
Open Terminal Tools terminal and enter the following commands. The process will let you press the return key and enter the Mac desktop password, follow the prompts to do the following:
" $ (curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install) "
2, download and install Cloc using homebrew.
Continue to enter in terminal:
Brew Install Cloc
3. Basic usage:
Count the current folder code lines (CD to destination directory first):
Cloc./
Exclude the code of a folder in the current directory, it is more common to exclude the code in pods, because half of pods is a third-party library, so here is the Pods folder as an example:
Cloc./--exclude-dir=pods
The statistical results are clear and extremely fast:
4. Advanced Usage
What should we do if we want to exclude more folders? Each person's memory ability is limited, want to know more usage the best way is to look at the cloc of the use of documents, in the terminal input:
Cloc--help
The results appear in several pages of instructions, according to the keyword we find the exclude option, which is described here:
This is simple, so we knock out the following command to achieve our goal:
Cloc./--exclude-dir=pods,wujiecaojoketest
In addition, based on the documentation, we can also filter out specific suffixes (EXT) and so on.
# #THAT is all.
Original articles, reproduced please indicate the program small Weng @ Blog Park, Mail [email Protected],jilon, welcome you and I in the c/c++/objective-c/machine vision and other fields to start communication!
A tool for counting the number of lines of code in any folder under "original" Mac--cloc