本文介绍了ctags命令不会递归说“它不是常规文件".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行ctags -R *时,出现错误,指出所有目录都不是常规文件,它会跳过它们,而不是递归地为它们生成标签.

When I run ctags -R *, I get errors saying that all directories are not regular files and it skips them instead of recursively generating tags for them.

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.

出什么问题了?

推荐答案

类似于和 ,问题是您没有运行Exuberant Ctags,而是在运行GNU Emacs etags,该库还提供了ctags可执行文件.运行ctags --version,您会看到类似这样的内容:

Similar to this and this, the problem is you're not running Exuberant Ctags, you're running GNU Emacs etags, which also provides a ctags executable. Run ctags --version and you'll see something like this:

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.实际上,手册页甚至没有提到递归作为选项.

And if you look in the man page, you'll see that -R is actually equivalent to --no-regex. In fact, the man page doesn't even mention recursion as an option.

   -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:

You could probably generate the tags recursively using shell magic, but you may run into problems down the road if you're expecting Exuberant Ctags. So the best solution is probably to install the ctags you want instead:

sudo apt-get install exuberant-ctags

旺盛的Ctags也可以从源代码安装:

Exuberant Ctags can also be installed from source:

http://ctags.sourceforge.net/

这篇关于ctags命令不会递归说“它不是常规文件".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-17 00:04