Skip to content

Commit e303ef2

Browse files
committed
Merge branch 'feature/add-tagline-support' into develop
2 parents e21d15f + deb5a34 commit e303ef2

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
@@ -217,7 +217,18 @@ if (isset($options['f']) && $options['f'] !== '-') {
217217
} else {
218218
$tagfile = fopen('tags', isset($options['a']) ? 'a' : 'w');
219219
}
220-
fwrite($tagfile, $result);
220+
221+
$mode = ($options['sort'] == 'yes' ? 1 : ($options['sort'] == 'foldcase' ? 2 : 0));
222+
$tagline = <<<EOF
223+
!_TAG_FILE_FORMAT\t2\t/extended format; --format=1 will not append ;" to lines/
224+
!_TAG_FILE_SORTED\t{$mode}\t/0=unsorted, 1=sorted, 2=foldcase/
225+
!_TAG_PROGRAM_AUTHOR\ttechlivezheng\t/techlivezheng@gmail.com/
226+
!_TAG_PROGRAM_NAME\tphpctags\t//
227+
!_TAG_PROGRAM_URL\thttps://github.com/techlivezheng/phpctags\t/official site/
228+
!_TAG_PROGRAM_VERSION\t0.3\t//\n
229+
EOF;
230+
231+
fwrite($tagfile, $tagline.$result);
221232
fclose($tagfile);
222233

223234
function yes_or_no($arg) {

0 commit comments

Comments
 (0)