gpt4 book ai didi

ctags - 更新大型项目中刚刚修改的文件的 cscope db 和 ctags

转载 作者:行者123 更新时间:2023-12-02 15:48:48 25 4
gpt4 key购买 nike

假设我的 c 项目 中有大约 100000 个 *.c *.h 文件。我使用 find 命令将其列出到 cscope.files 中,然后从中创建 cscope.out 和标记文件,如下所示。

1. find `pwd` -type f \( -name "*.c" -o -name "*.h" \) > cscope.files
2. /usr/bin/ctags -L cscope.files
3. cscope -b -i cscope.files -f cscope.out

完成此操作需要 25 - 30 分钟的时间。如果我修改单个 c 文件,那么如果我想更新 ctags,则需要大约 20 分钟,因为我正在更新整个 c 项目(即步骤 2,3)。那么有没有什么方法可以通过更新更改的 c 文件来更快地更新 cscope.out 和标签文件。

最佳答案

您可以使用 ctags 为一组文件生成标签(修改时间大于 .tags 修改时间),并使用 --append 开关将结果附加到当前现有标签:

ctags --recurse --verbose --append --extra=+q --fields=+aimS --c-kinds=+p --c++-kinds=+p -L list_of_files

更多信息:https://gist.github.com/Flolagale/5195934

关于ctags - 更新大型项目中刚刚修改的文件的 cscope db 和 ctags,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37243426/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com