jianzong
5.92D

数一数你的 iOS 项目行数

  •  
  •   jianzong · Jan 22, 2015 · 2390 views
    This topic created in 4171 days ago, the information mentioned may be changed or developed.

    不数不知道,一数吓一跳,本来以为自己在写2k行代码的项目,数出来居然是13k。

    在terminal中cd到项目目录:

    find . "(" -name "*.h" -or -name "*.m" -or -name "*.mm" -or -name "*.hpp" -or -name "*.cpp" -or -name "*.c" -or -name "*.cc" ")" -print0 | xargs -0 wc -l

    可以打印出每个文件的行数。

    4 replies    2015-03-06 13:12:02 +08:00
    dcty
        1
    dcty  
       Jan 22, 2015
    414825 total
    但是没有什么实际的参考意义。
    jianzong
        2
    jianzong  
    OP
       Jan 22, 2015
    @dcty 包含第三方库吗?
    dcty
        3
    dcty  
       Jan 22, 2015
    @jianzong 673373 total
    TL
        4
    TL  
       Mar 6, 2015   ❤️ 1
    @jianzong 可以用 cloc 这个比较准确,除去注释,空行等。

    http://cloc.sourceforge.net/
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   916 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 20:06 · PVG 04:06 · LAX 13:06 · JFK 16:06
    ♥ Do have faith in what you're doing.