Skip to content

Commit deb5a34

Browse files
markwuweynhamz
authored andcommitted
Add tagline support for phpctags.
1 parent b4d1f13 commit deb5a34

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

phpctags

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,18 @@ if (isset($options['f']) && $options['f'] !== '-') {
215215
} else {
216216
$tagfile = fopen('tags', isset($options['a']) ? 'a' : 'w');
217217
}
218-
fwrite($tagfile, $result);
218+
219+
$mode = ($options['sort'] == 'yes' ? 1 : ($options['sort'] == 'foldcase' ? 2 : 0));
220+
$tagline = <<<EOF
221+
!_TAG_FILE_FORMAT\t2\t/extended format; --format=1 will not append ;" to lines/
222+
!_TAG_FILE_SORTED\t{$mode}\t/0=unsorted, 1=sorted, 2=foldcase/
223+
!_TAG_PROGRAM_AUTHOR\ttechlivezheng\t/techlivezheng@gmail.com/
224+
!_TAG_PROGRAM_NAME\tphpctags\t//
225+
!_TAG_PROGRAM_URL\thttps://github.com/techlivezheng/phpctags\t/official site/
226+
!_TAG_PROGRAM_VERSION\t0.3\t//\n
227+
EOF;
228+
229+
fwrite($tagfile, $tagline.$result);
219230
fclose($tagfile);
220231

221232
function yes_or_no($arg) {

0 commit comments

Comments
 (0)