当我运行ctags -R *
时,我收到错误消息,指出所有目录都不是常规文件,它会跳过它们,而不是为它们递归生成标签。
ctags: skipping arpa: it is not a regular file.
ctags: skipping asm: it is not a regular file.
ctags: skipping asm-generic: it is not a regular file.
ctags: skipping bits: it is not a regular file.
ctags: skipping blkid: it is not a regular file.
ctags: skipping boost: it is not a regular file.
问题是什么?
最佳答案
与this和this相似,问题在于您没有运行Exuberant Ctags,而是在运行GNU Emacs etags
,它也提供了ctags
可执行文件。运行ctags --version
,您将看到类似以下内容:
ctags (GNU Emacs 23.1)
Copyright (C) 2009 Free Software Foundation, Inc.
This program is distributed under the terms in ETAGS.README
而且,如果您查看手册页,将会看到
-R
实际上等效于--no-regex
。实际上,手册页甚至没有提到递归作为选项。 -R, --no-regex
Don't do any more regexp matching on the following files. May
be freely intermixed with filenames and the --regex option.
您可能可以使用Shell Magic递归生成标签,但是如果您期望使用Exuberant Ctags,则可能会遇到麻烦。因此,最好的解决方案可能是安装所需的ctags:
sudo apt-get install exuberant-ctags
旺盛的Ctags也可以从源代码安装:
http://ctags.sourceforge.net/
关于ctags - ctags命令不会递归说 “it is not a regular file”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2968542/