Skip to content

Commit 7c19f9d

Browse files
committed
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.
1 parent 3aa42c2 commit 7c19f9d

File tree

1 file changed

+31
-10
lines changed

1 file changed

+31
-10
lines changed

src/tools/make_ctags

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,41 @@
55
trap "rm -f /tmp/$$" 0 1 2 3 15
66
rm -f ./tags
77

8-
cv=`ctags --version 2>&1 | grep Exuberant`
8+
IS_EXUBERANT=""
9+
ctags --version 2>&1 | grep Exuberant && IS_EXUBERANT="Y"
910

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"
1331
fi
1432

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"
1836

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
2243
export LC_ALL
2344
sort tags >/tmp/$$ && mv /tmp/$$ tags
2445
fi

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy