--exclude=[pattern]
Add pattern to a list of excluded files and directories. This option may
be specified as many times as desired. For each file name considered by
both the complete path (e.g. some/path/base.ext) and the base name (e.g.
base.ext) of the file, thus allowing patterns which match a given file
name irrespective of its path, or match only a specific path. If appro-
priate support is available from the runtime library of your C compiler,
then pattern may contain the usual shell wildcards (not regular expres-
sions) common on Unix (be sure to quote the option parameter to protect
the wildcards from being expanded by the shell before being passed to
ctags; also be aware that wildcards can match the slash character, '/').
You can determine if shell wildcards are available on your platform by
examining the output of the --version option, which will include "+wild-
cards" in the compiled feature list; otherwise, pattern is matched
against file names using a simple textual comparison.
If pattern begins with the character '@', then the rest of the string is
interpreted as a file name from which to read exclusion patterns, one per
line. If pattern is empty, the list of excluded patterns is cleared.
Note that at program startup, the default exclude list contains "EIFGEN",
"SCCS", "RCS", and "CVS", which are names of directories for which it is
generally not desirable to descend while processing the --recurse option.
6条答案
按热度按时间atmip9wb1#
--exclude
选项不需要文件列表。根据ctags
的手册页,“此选项可以根据需要指定任意多次。”因此,它是这样的:ctags -R --exclude=.git --exclude=node_modules --exclude=test
lqfhib0f2#
读一读他妈的太棒了手册应该永远是解决问题的第一步。
从
$ man ctags
开始:从前两句话中你可以得到:
这可能有点冗长,但这正是别名和Map等的作用。作为替代,您可以从第二段中获得以下内容:
在
.ctagsignore
中包含以下内容:这样就排除了这3个目录,而不需要键入太多内容。
l2osamch3#
您可以使用大括号封装逗号分隔的列表,以便使用一个
--exclude
选项处理多个列表:这似乎只适用于您发出命令的根目录中的文件夹。排除嵌套文件夹需要单独的
--exclude
选项。sxpgvts34#
其他人的回答都很直奔主题,我想举个小例子可能会有所帮助:
您应该添加一个类似Unix的星号样式来排除整个目录。
x33g5p2x5#
有点晚了,但是在romainl响应之后,你可以使用你的.gitignore文件作为基础,你只需要从文件中删除任何前导斜杠,如下所示:
bis0qfac6#
我真的只需要让它在我的核心目录中运行。
只需删除-R(递归)标志!!!