V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
jianzong
5.92D

数一数你的 iOS 项目行数

  •  
  •   jianzong · Jan 22, 2015 · 2303 views
    This topic created in 4121 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   ·   923 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 18:29 · PVG 02:29 · LAX 11:29 · JFK 14:29
    ♥ Do have faith in what you're doing.