ctags 命令不会递归地说“它不是常规文件”。

发布于 2024-09-03 17:43:48 字数 419 浏览 5 评论 0原文

当我运行 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.

问题是什么?

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.

What is the problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

仙气飘飘 2024-09-10 17:43:48

类似于 这个,问题是你没有运行 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 实际上相当于 --无正则表达式。事实上,手册页甚至没有提到递归作为一个选项。

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

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

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.

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

Exuberant Ctags can also be installed from source:

http://ctags.sourceforge.net/
独木成林 2024-09-10 17:43:48

如果您安装了 elvis-tools,就会发生这种情况。使用类似的方法删除它们

sudo apt-get remove elvis-tools 

,然后安装 exuberant-ctags

sudo apt-get install exuberant-ctags

It occurs if you have elvis-tools installed . remove them with something like

sudo apt-get remove elvis-tools 

and then install exuberant-ctags by

sudo apt-get install exuberant-ctags
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文