Selecting a subset of files for ctags

I usually don’t want all of the files in the linux Kernel for my ctags. Sometimes I want a cvery small subset: a set of C files and the included header files.

#!/bin/sh
 
for CFILE in drivers/net/mctp/mctp-pcc.c drivers/mailbox/mailbox.c drivers/mailbox/pcc.c drivers/mailbox/mailbox.h
do
        echo $CFILE
        for HFILE in `grep "#include <" $CFILE | cut -f2 -d '<' | sed 's/.$//' `
                do
                        echo include/$HFILE
                done
done

Call it using

 ctags ` ~/ctag-select.sh | sort -u `

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.