Skip to content

Commit f50914f

Browse files
author
Martin Hoch hoch@fidion.de
committed
Added --kinds option.
Possible Flags are: 'c' => 'class', 'm' => 'method', 'f' => 'function', 'p' => 'property', 'd' => 'constant', 'v' => 'variable', 'i' => 'interface', Adding/Substracting single Flags is not supported.
1 parent 94553de commit f50914f

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

PHPCtags.class.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ private function render()
240240
foreach ($this->mStructs as $struct) {
241241
$file = $struct['file'];
242242

243+
if (!in_array($struct['kind'], $this->mOptions['kinds'])) {
244+
continue;
245+
}
246+
243247
if (!isset($files[$file]))
244248
$files[$file] = file($file);
245249

bootstrap.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
'exclude:',
2525
'excmd::',
2626
'fields::',
27+
'kinds::',
2728
'format::',
2829
'help',
2930
'recurse::',
@@ -57,7 +58,9 @@
5758
--excmd=number|pattern|mix
5859
Uses the specified type of EX command to locate tags [mix].
5960
--fields=[+|-]flags
60-
Include selected extension fields (flags: "afmikKlnsStz") [fks].
61+
Include selected extension fields (flags: "afmikKlnsStz") [fks].
62+
--kinds=[+|-]flags
63+
Enable/disable tag kinds [cmfpvdi]
6164
--format=level
6265
Force output of specified tag file format [2].
6366
--help
@@ -141,12 +144,20 @@
141144
$options['format'] = 2;
142145
if (!isset($options['memory']))
143146
$options['memory'] = '128M';
147+
144148
if (!isset($options['fields'])) {
145149
$options['fields'] = array('n', 'k', 's', 'a');
146150
} else {
147151
$options['fields'] = str_split($options['fields']);
148152
}
149153

154+
if (!isset($options['kinds'])) {
155+
$options['kinds'] = array('c', 'm', 'f', 'p', 'd', 'v', 'i');
156+
} else {
157+
$options['kinds'] = str_split($options['kinds']);
158+
}
159+
160+
150161
// handle -u or --sort options
151162
if (isset($options['sort'])) {
152163
// --sort or --sort=[Y,y,YES,Yes,yes]

0 commit comments

Comments
 (0)