如何使用魔法外壳创建使用GNU ETag的递归ETag的? [英] How to use shell magic to create a recursive etags using GNU etags?
问题描述
由旺盛完成的标准GNU 的ETag
不支持目录的递归散步的ctags -R
。如果我只获得了GNU的ETag,我该如何使用bash shell的魔法让ETag来产生一个标记表的所有C ++文件 *。CPP
和 *的.h
在当前目录下的文件和所有目录下当前递归,其中有 emacs的正确的路径名在当前目录下创建一个标签表
来解决TAGS表项。
The standard GNU etags
does not support a recursive walk of directories as done by exuberant ctags -R
. If I only have access to the GNU etags, how can I use bash shell magic to get etags to produce a TAGS table for all the C++ files *.cpp
and *.h
files in the current directory and all directories below the current one recursively to create a TAGS table in the current directory which has the proper path name for emacs
to resolve the TAGS table entries.
推荐答案
借助 Emacs的维基往往是答案的良好来源常见问题或最佳实践。为了您的具体问题有适用于Windows和Unixen双方的解决方案:
The Emacs Wiki is often a good source for answers to common problems or best practices. For your specific problem there is a solution for both Windows and Unixen:
<一个href=\"http://www.emacswiki.org/emacs/RecursiveTags#toc2\">http://www.emacswiki.org/emacs/RecursiveTags#toc2
基本上你运行一个命令来查找所有的.cpp
和所有 .H
文件(如果您更改文件选择器使用不同的文件结尾,如如 .C
)和管道,结果到的ETag。由于Windows似乎并不具备xargs的,你需要一个更近的,可以从标准输入读取(注意这象征标准输入行的末尾破折号)的ETag的版本。当然,如果你使用最新的ETag版本,您可以使用破折号参数,而不是xargs的那里。
Basically you run a command to find all .cpp
and all .h
files (change file selectors if you use different file endings, such as e.g., .C
) and pipe the result into etags. Since Windows does not seem to have xargs, you need a more recent version of etags that can read from stdin (note the dash at the end of the line which symbolizes stdin). Of course, if you use a recent version of etags, you can use the dash parameter instead of xargs there, too.
的Windows
cd c:\source-root
dir /b /s *.cpp *.h *.hpp | etags --your_options -
的Unix
cd /path/to/source-root
find . -name "*.cpp" -print -or -name "*.h" -print | xargs etags --append
这篇关于如何使用魔法外壳创建使用GNU ETag的递归ETag的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!