|
5 | 5 | trap "rm -f /tmp/$$" 0 1 2 3 15
|
6 | 6 | rm -f ./tags
|
7 | 7 |
|
8 |
| -cv=`ctags --version 2>&1 | grep Exuberant` |
| 8 | +IS_EXUBERANT="" |
| 9 | +ctags --version 2>&1 | grep Exuberant && IS_EXUBERANT="Y" |
9 | 10 |
|
10 |
| -if [ -z "$cv" ] |
11 |
| -then FLAGS="-dt" |
12 |
| -else FLAGS="--c-types=+dfmstuv" |
| 11 | +# List of kinds supported by Exuberant Ctags 5.8 |
| 12 | +# generated by ctags --list-kinds |
| 13 | +# c classes |
| 14 | +# d macro definitions |
| 15 | +# e enumerators (values inside an enumeration) |
| 16 | +# f function definitions |
| 17 | +# g enumeration names |
| 18 | +# l local variables [off] |
| 19 | +# m class, struct, and union members |
| 20 | +# n namespaces |
| 21 | +# p function prototypes [off] |
| 22 | +# s structure names |
| 23 | +# t typedefs |
| 24 | +# u union names |
| 25 | +# v variable definitions |
| 26 | +# x external and forward variable declarations [off] |
| 27 | + |
| 28 | +if [ "$IS_EXUBERANT" ] |
| 29 | +then FLAGS="--c-kinds=+dfmstuv" |
| 30 | +else FLAGS="-dt" |
13 | 31 | fi
|
14 | 32 |
|
15 |
| -find `pwd`/ \( -name _deadcode -prune \) -o \ |
16 |
| - -type f -name '*.[chyl]' -print | |
17 |
| - xargs ctags "$FLAGS" -a -f tags |
| 33 | +# this is outputting the tags into the file 'tags', and appending |
| 34 | +find `pwd`/ -type f -name '*.[chyl]' -print | |
| 35 | + xargs ctags -a -f tags "$FLAGS" |
18 | 36 |
|
19 |
| -if [ -z "$cv" ] |
20 |
| -then |
21 |
| - LC_ALL=C |
| 37 | +# Exuberant tags has a header that we cannot sort in with the other entries |
| 38 | +# so we skip the sort step |
| 39 | +# Why are we sorting this? I guess some tag implementation need this, |
| 40 | +# particularly for append mode. bjm 2012-02-24 |
| 41 | +if [ ! "$IS_EXUBERANT" ] |
| 42 | +then LC_ALL=C |
22 | 43 | export LC_ALL
|
23 | 44 | sort tags >/tmp/$$ && mv /tmp/$$ tags
|
24 | 45 | fi
|
|
0 commit comments