当前位置: 首页 > 工具软件 > Ctags > 使用案例 >

ctags 工具

汪晨
2023-12-01
sudo apt-get install ctags
其实安装的是 exuberant-ctags
$ dpkg -L exuberant-ctags 
/.
/usr
/usr/bin
/usr/bin/ctags-exuberant
/usr/share
/usr/share/doc
/usr/share/doc/exuberant-ctags
/usr/share/doc/exuberant-ctags/FAQ.gz
/usr/share/doc/exuberant-ctags/changelog.Debian.gz
/usr/share/doc/exuberant-ctags/copyright
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/ctags-exuberant.1.gz
$ ls -l /usr/bin/ctags 
lrwxrwxrwx 1 root root 23 Sep 14  2021 /usr/bin/ctags -> /etc/alternatives/ctags

使用方法

ctags [options] [file(s)]
  • [options]
-x   				 	Print  a tabular
--exclude=[pattern]  	Add  pattern to a list of excluded files and directories.
$ ctags --list-maps=c
C        *.c

$  ctags --list-kinds=c
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]
 类似资料: