Skip to content

Commit a1671fe

Browse files
committed
readtags: fix the output of the combination of --{list,with}-pseudo-tags and -{A,C}
The behavior of the long options should be the same as -{D,P}. However, when specifying them with -A or -C, readtags didn't canonicalize the input field for !_TAG_PROC_CWD pseudo tag. Signed-off-by: Masatake YAMATO <[email protected]>
1 parent 68a7776 commit a1671fe

File tree

4 files changed

+32
-2
lines changed

4 files changed

+32
-2
lines changed

Tmain/readtags-canonicalize-input-names.d/run.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ run_test good2.tags -C -l &&
3333
! run_test drive-letter0.tags --canonicalize-input -l &&
3434
! run_test drive-letter1.tags -C -l &&
3535
run_test good-ptags.tags -C -D &&
36+
run_test good-ptags.tags -C --list-pseudo-tags &&
3637
run_test good0.tags -A -l &&
3738
run_test good1.tags --absolute-input -l &&
3839
run_test good2.tags -A -l &&
3940
! run_test drive-letter0.tags --absolute-input -l &&
4041
! run_test drive-letter1.tags -A -l &&
41-
run_test good-ptags.tags -A -D
42+
run_test good-ptags.tags -A -D &&
43+
run_test good-ptags.tags -A --list-pseudo-tags

Tmain/readtags-canonicalize-input-names.d/stderr-expected.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# drive-letter1.tags -C -l
77
!_TAG_PROC_CWD must start with '/': D:/tmp
88
# good-ptags.tags -C -D
9+
# good-ptags.tags -C --list-pseudo-tags
910
# good0.tags -A -l
1011
# good1.tags --absolute-input -l
1112
# good2.tags -A -l
@@ -14,3 +15,4 @@
1415
# drive-letter1.tags -A -l
1516
!_TAG_PROC_CWD must start with '/': D:/tmp
1617
# good-ptags.tags -A -D
18+
# good-ptags.tags -A --list-pseudo-tags

Tmain/readtags-canonicalize-input-names.d/stdout-expected.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,19 @@ w_fn /abc/w.c
8585
!_TAG_PROGRAM_URL https://ctags.io/ /official site/
8686
!_TAG_PROGRAM_VERSION 5.9.0 /e08db39a3/
8787
!_TAG_PROC_DUMMY /../../tmp //
88+
# good-ptags.tags -C --list-pseudo-tags
89+
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
90+
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
91+
!_TAG_OUTPUT_EXCMD mixed /number, pattern, mixed, or combineV2/
92+
!_TAG_OUTPUT_FILESEP slash /slash or backslash/
93+
!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
94+
!_TAG_PATTERN_LENGTH_LIMIT 96 /0 for no limit/
95+
!_TAG_PROC_CWD /tmp //
96+
!_TAG_PROGRAM_AUTHOR Universal Ctags Team //
97+
!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
98+
!_TAG_PROGRAM_URL https://ctags.io/ /official site/
99+
!_TAG_PROGRAM_VERSION 5.9.0 /e08db39a3/
100+
!_TAG_PROC_DUMMY /../../tmp //
88101
# good0.tags -A -l
89102
a_fn /tmp/abc/xyz/a.c
90103
b_fn /tmp/abc/b.c
@@ -172,3 +185,16 @@ w_fn /abc/w.c
172185
!_TAG_PROGRAM_URL https://ctags.io/ /official site/
173186
!_TAG_PROGRAM_VERSION 5.9.0 /e08db39a3/
174187
!_TAG_PROC_DUMMY /../../tmp //
188+
# good-ptags.tags -A --list-pseudo-tags
189+
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
190+
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
191+
!_TAG_OUTPUT_EXCMD mixed /number, pattern, mixed, or combineV2/
192+
!_TAG_OUTPUT_FILESEP slash /slash or backslash/
193+
!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
194+
!_TAG_PATTERN_LENGTH_LIMIT 96 /0 for no limit/
195+
!_TAG_PROC_CWD /tmp //
196+
!_TAG_PROGRAM_AUTHOR Universal Ctags Team //
197+
!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
198+
!_TAG_PROGRAM_URL https://ctags.io/ /official site/
199+
!_TAG_PROGRAM_VERSION 5.9.0 /e08db39a3/
200+
!_TAG_PROC_DUMMY /../../tmp //

extra-cmds/readtags-cmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ extern int main (int argc, char **argv)
708708
{
709709
if (canon)
710710
canon->ptags = 1;
711-
listTags (1, &printOpts, NULL);
711+
listTags (1, &printOpts, canon);
712712
if (optname[0] == 'l')
713713
actionSupplied = 1;
714714
}

0 commit comments

Comments
 (0)