Update src/tools/make_ctags to avoid Exuberant tags option
that has been renamed and undocumented since 2003; instead, use the documented option. Add comments.
This commit is contained in:
parent
3aa42c25c3
commit
7c19f9d139
|
@ -5,20 +5,41 @@
|
||||||
trap "rm -f /tmp/$$" 0 1 2 3 15
|
trap "rm -f /tmp/$$" 0 1 2 3 15
|
||||||
rm -f ./tags
|
rm -f ./tags
|
||||||
|
|
||||||
cv=`ctags --version 2>&1 | grep Exuberant`
|
IS_EXUBERANT=""
|
||||||
|
ctags --version 2>&1 | grep Exuberant && IS_EXUBERANT="Y"
|
||||||
|
|
||||||
if [ -z "$cv" ]
|
# List of kinds supported by Exuberant Ctags 5.8
|
||||||
then FLAGS="-dt"
|
# generated by ctags --list-kinds
|
||||||
else FLAGS="--c-types=+dfmstuv"
|
# c classes
|
||||||
|
# d macro definitions
|
||||||
|
# e enumerators (values inside an enumeration)
|
||||||
|
# f function definitions
|
||||||
|
# g enumeration names
|
||||||
|
# l local variables [off]
|
||||||
|
# m class, struct, and union members
|
||||||
|
# n namespaces
|
||||||
|
# p function prototypes [off]
|
||||||
|
# s structure names
|
||||||
|
# t typedefs
|
||||||
|
# u union names
|
||||||
|
# v variable definitions
|
||||||
|
# x external and forward variable declarations [off]
|
||||||
|
|
||||||
|
if [ "$IS_EXUBERANT" ]
|
||||||
|
then FLAGS="--c-kinds=+dfmstuv"
|
||||||
|
else FLAGS="-dt"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
find `pwd`/ \( -name _deadcode -prune \) -o \
|
# this is outputting the tags into the file 'tags', and appending
|
||||||
-type f -name '*.[chyl]' -print |
|
find `pwd`/ -type f -name '*.[chyl]' -print |
|
||||||
xargs ctags "$FLAGS" -a -f tags
|
xargs ctags -a -f tags "$FLAGS"
|
||||||
|
|
||||||
if [ -z "$cv" ]
|
# Exuberant tags has a header that we cannot sort in with the other entries
|
||||||
then
|
# so we skip the sort step
|
||||||
LC_ALL=C
|
# Why are we sorting this? I guess some tag implementation need this,
|
||||||
|
# particularly for append mode. bjm 2012-02-24
|
||||||
|
if [ ! "$IS_EXUBERANT" ]
|
||||||
|
then LC_ALL=C
|
||||||
export LC_ALL
|
export LC_ALL
|
||||||
sort tags >/tmp/$$ && mv /tmp/$$ tags
|
sort tags >/tmp/$$ && mv /tmp/$$ tags
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue