当我跑步时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 https://stackoverflow.com/questions/2580313/ctags-doesnt-undestand-e-option-no-exuberant-tags-option and this https://stackoverflow.com/questions/2634001/any-idea-why-ctags-wont-recurse-on-cygwin,问题是你运行的不是 Exuberant Ctags,而是 GNU Emacsetags
,它还提供了一个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
Exuberant Ctags 也可以从源安装:
http://ctags.sourceforge.net/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)