|
24 | 24 | 'exclude:', |
25 | 25 | 'excmd::', |
26 | 26 | 'fields::', |
| 27 | + 'kinds::', |
27 | 28 | 'format::', |
28 | 29 | 'help', |
29 | 30 | 'recurse::', |
|
57 | 58 | --excmd=number|pattern|mix |
58 | 59 | Uses the specified type of EX command to locate tags [mix]. |
59 | 60 | --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] |
61 | 64 | --format=level |
62 | 65 | Force output of specified tag file format [2]. |
63 | 66 | --help |
|
141 | 144 | $options['format'] = 2; |
142 | 145 | if (!isset($options['memory'])) |
143 | 146 | $options['memory'] = '128M'; |
| 147 | + |
144 | 148 | if (!isset($options['fields'])) { |
145 | 149 | $options['fields'] = array('n', 'k', 's', 'a','i'); |
146 | 150 | } else { |
147 | 151 | $options['fields'] = str_split($options['fields']); |
148 | 152 | } |
149 | 153 |
|
| 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 | + |
150 | 161 | // handle -u or --sort options |
151 | 162 | if (isset($options['sort'])) { |
152 | 163 | // --sort or --sort=[Y,y,YES,Yes,yes] |
|
218 | 229 | } |
219 | 230 |
|
220 | 231 | $mode = ($options['sort'] == 'yes' ? 1 : ($options['sort'] == 'foldcase' ? 2 : 0)); |
| 232 | + |
| 233 | +if (!isset($options['a'])) { |
221 | 234 | $tagline = <<<EOF |
222 | 235 | !_TAG_FILE_FORMAT\t2\t/extended format; --format=1 will not append ;" to lines/ |
223 | 236 | !_TAG_FILE_SORTED\t{$mode}\t/0=unsorted, 1=sorted, 2=foldcase/ |
|
226 | 239 | !_TAG_PROGRAM_URL\thttps://github.com/techlivezheng/phpctags\t/official site/ |
227 | 240 | !_TAG_PROGRAM_VERSION\t${version}\t//\n |
228 | 241 | EOF; |
| 242 | +} |
229 | 243 |
|
230 | 244 | fwrite($tagfile, $tagline.$result); |
231 | 245 | fclose($tagfile); |
|
0 commit comments