ctags icon indicating copy to clipboard operation
ctags copied to clipboard

[question, documentation] how to include subdirectories foo.lib or bar.so

Open XSven opened this issue 3 years ago • 1 comments

I have to maintain a C, C++ source code project.

When I am recursively indexing the files, all files located in subdirectories that have (strangely of course) names ending with .lib or .so are ignored. Yes it is the subdirectory name that ends with .lib or .so!

My guess is that this behaviour has something to do with the *.lib and *.so entries in --list-excludes.

Although I have read the documentation carefully I haven't found any way to include these kind subdirectories. I have tried to use --exclude-exception but because I am not explicitly --exclude a pattern this procedure does not work for me.

Any help would be very much appreciated and maybe the documentation could consider this use case too.

XSven avatar Jun 18 '21 06:06 XSven

I have just found a bug in --exclude-exception. But following command line may work even with the bug.

There are two ways.

A. resetting the exclusion list:

$ mkdir -p src/mylib.so
$ echo 'int main(void) { return 0; }' > src/mylib.so/foo.c
$ ./ctags --options=NONE -R -o - src
ctags: Notice: No options will be read from files or environment
$ ./ctags --options=NONE --exclude= -R -o - src
ctags: Notice: No options will be read from files or environment
main	src/mylib.so/foo.c	/^int main(void) { return 0; }$/;"	f	typeref:typename:int

B. using --exclude-exception

./ctags --verbose --options=NONE --exclude-exception='*.so' -R -o - src

Because of the bug, you can specify any string instead of *.so to get the same result.

masatake avatar Jun 18 '21 07:06 masatake