使用find命令创建ctags(用于代码导航)
我有一个项目的大型代码存储库,我正在尝试通过 emacs 标签对其进行搜索。因此,我进入主目录,尝试使用此命令生成标签:
find . -name *.[chsS] | xargs etags -
但是我得到响应“find:No match”。
当我单独键入“查找”命令时,它会列出所有代码文件和子目录,其中包含我希望标记的更多代码文件。
我怎样才能做到这一点?澄清一下,我希望能够使用 emacs M-。和 M-* 在大型存储库中浏览代码标签。
非常赞赏。
I have a big code repository for a project and I'm trying to make it searchable via emacs TAGS. So I go into the main directory and I try using this command to generate the tags:
find . -name *.[chsS] | xargs etags -
However I get the response "find: No match."
When I just type the "find" command on its own, it lists all the code files and subdirectories with more code files that I wish to tag.
How can I make this work? Just to make clear, I want to be able to use the emacs M-. and M-* to navigate around code tags in a big repository.
Greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我打电话给 shannanigans ,因为您声称这有效:
在这里,您的交互式 shell 会将“*.[chsS]”扩展为文件列表,并且第一个文件将被接受作为“name”参数。但 find 会尝试将第二个文件解释为选项,并且它无效。
这里的教训是用单引号、双引号或反斜杠引用传递的通配符来查找。
I call shannanigans on your claim that this works:
Here, your interactive shell would expand "*.[chsS]" into a list of files, and the first one would be accepted as the "name" parameter. But find will try to interpret the second file as an option, and it won't be valid.
The lesson here is to quote wildcards passed to find either with single-quotes, double-quotes, or backslash.
对于使用 ctags 工具的 C 和头文件,
此命令将包含扩展名为
.c
和.h
的源文件For C and header files using ctags tool,
This command will include the source file with extension
.c
and.h
如果您使用 https://ctags.io 开发的 ctags
可能会生成 TAGS 文件。
If you use ctags developed at https://ctags.io
may generate TAGS file.