V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
jianzong
V2EX  ›  分享发现

数一数你的 iOS 项目行数

  •  
  •   jianzong · 2015-01-22 18:30:23 +08:00 · 1904 次点击
    这是一个创建于 3405 天前的主题,其中的信息可能已经有所发展或是发生改变。

    不数不知道,一数吓一跳,本来以为自己在写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 条回复    2015-03-06 13:12:02 +08:00
    dcty
        1
    dcty  
       2015-01-22 20:08:51 +08:00
    414825 total
    但是没有什么实际的参考意义。
    jianzong
        2
    jianzong  
    OP
       2015-01-22 20:15:03 +08:00
    @dcty 包含第三方库吗?
    dcty
        3
    dcty  
       2015-01-22 20:39:30 +08:00
    @jianzong 673373 total
    TL
        4
    TL  
       2015-03-06 13:12:02 +08:00   ❤️ 1
    @jianzong 可以用 cloc 这个比较准确,除去注释,空行等。

    http://cloc.sourceforge.net/
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2487 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 14:16 · PVG 22:16 · LAX 07:16 · JFK 10:16
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.