Skip to content

Commit 2fd9b0c

Browse files
authored
Merge pull request #3594 from masatake/output-versioning
main: output versioning and shorten output mode for --version
2 parents ebc90c2 + 0a2c667 commit 2fd9b0c

File tree

30 files changed

+132
-82
lines changed

30 files changed

+132
-82
lines changed

Tmain/extras-field-for-pseudo-tags.d/run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ run_ctags()
1111
--pseudo-tags=-TAG_PROGRAM_VERSION \
1212
--pseudo-tags=-TAG_PROC_CWD \
1313
--pseudo-tags=-TAG_PARSER_VERSION \
14+
--pseudo-tags=-TAG_OUTPUT_VERSION \
1415
$@ \
1516
-o - input.c
1617
}

Tmain/input-encoding-option.d/run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ if ${CTAGS} --quiet --options=NONE --list-features | grep -q iconv; then
2020
--pseudo-tags=-TAG_FIELD_DESCRIPTION \
2121
--pseudo-tags=-TAG_ROLE_DESCRIPTION \
2222
--pseudo-tags=-TAG_PARSER_VERSION \
23+
--pseudo-tags=-TAG_OUTPUT_VERSION \
2324
--input-encoding=utf-8 --input-encoding-java=shift_jis --input-encoding-javascript=euc-jp \
2425
-o ${BUILDDIR}/tags \
2526
input.js input.java ; then

Tmain/interactive-mode.d/run.sh

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,42 @@ is_feature_available ${CTAGS} interactive
99
# It seems that the output format is slightly different between libjansson versions
1010
s()
1111
{
12-
sed -e s/':"'/': "'/g
12+
sed -e s/':"'/': "'/g | jdropver
1313
}
1414

1515
CTAGS="$CTAGS --options=NONE"
16-
NV="--pseudo-tags=-TAG_PROGRAM_VERSION"
1716

1817
echo identification message on startup
1918
echo =======================================
20-
${CTAGS} --_interactive $NV < /dev/null |s
19+
${CTAGS} --_interactive < /dev/null |s
2120

2221
echo
2322
echo error on invalid command
2423
echo =======================================
25-
echo '{"command":"foobar"}' | ${CTAGS} --_interactive $NV |s
24+
echo '{"command":"foobar"}' | ${CTAGS} --_interactive |s
2625

2726
echo
2827
echo error on missing arguments
2928
echo =======================================
30-
echo '{"command":"generate-tags"}' | ${CTAGS} --_interactive $NV |s
29+
echo '{"command":"generate-tags"}' | ${CTAGS} --_interactive |s
3130

3231
echo
3332
echo error on invalid file
3433
echo =======================================
35-
echo '{"command":"generate-tags", "filename":"test.foo"}' | ${CTAGS} --_interactive $NV |s
34+
echo '{"command":"generate-tags", "filename":"test.foo"}' | ${CTAGS} --_interactive |s
3635

3736
echo
3837
echo generate tags from file
3938
echo =======================================
40-
echo '{"command":"generate-tags", "filename":"test.rb"}' | ${CTAGS} --_interactive $NV |s
39+
echo '{"command":"generate-tags", "filename":"test.rb"}' | ${CTAGS} --_interactive |s
4140

4241
echo
4342
echo process multiple commands
4443
echo =======================================
4544
(
4645
echo '{"command":"generate-tags", "filename":"test.rb"}'
4746
echo '{"command":"generate-tags", "filename":"test.c"}'
48-
) | ${CTAGS} --_interactive $NV |s
47+
) | ${CTAGS} --_interactive |s
4948

5049
echo
5150
echo generate tags from data
@@ -54,4 +53,4 @@ size=$(filesize test.rb)
5453
(
5554
echo '{"command":"generate-tags", "filename":"foobar.rb", "size":'$size'}'
5655
cat test.rb
57-
) | ${CTAGS} --_interactive $NV |s
56+
) | ${CTAGS} --_interactive |s

Tmain/interactive-notice-output.d/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ CTAGS=$1
88
# It seems that the output format is slightly different between libjansson versions
99
s()
1010
{
11-
sed -e s/':"'/': "'/g
11+
sed -e s/':"'/': "'/g | jdropver
1212
}
1313

1414
if is_feature_available ${CTAGS} json; then

Tmain/interactive-option-write-to-file.d/run.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ is_feature_available ${CTAGS} interactive
1111
# It seems that the output format is slightly different between libjansson versions
1212
s()
1313
{
14-
sed -e s/':"'/': "'/g
14+
sed -e s/':"'/': "'/g | jdropver
1515
}
1616

1717
O=/tmp/ctags-tmain-$$.txt
1818

19-
echo '{"command":"generate-tags", "filename":"test.rb"}' | ${CTAGS} --quiet --options=NONE --_interactive -o ${O} \
20-
--pseudo-tags=-TAG_PROGRAM_VERSION |s
19+
echo '{"command":"generate-tags", "filename":"test.rb"}' | ${CTAGS} --quiet --options=NONE --_interactive -o ${O} |s
2120

2221
rm -f ${O}

Tmain/json-output-format.d/run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ if is_feature_available "${CTAGS}" json; then
1212
run_with_format json --languages=+man --fields="*"-T --extras='*'
1313
} | cat \
1414
| grep -v TAG_PROGRAM_VERSION \
15+
| grep -v TAG_OUTPUT_VERSION \
1516
| grep -v TAG_OUTPUT_FILESEP \
1617
| grep -v TAG_PROC_CWD
1718
fi

Tmain/list-pseudo-tags.d/stdout-expected.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ TAG_KIND_SEPARATOR off the separators used in kinds
99
TAG_OUTPUT_EXCMD on the excmd: number, pattern, mixed, or combine
1010
TAG_OUTPUT_FILESEP on the separator used in file name (slash or backslash)
1111
TAG_OUTPUT_MODE on the output mode: u-ctags or e-ctags
12+
TAG_OUTPUT_VERSION on the version of the output interface (current.age)
1213
TAG_PARSER_VERSION on the version of the parser (current.age)
1314
TAG_PATTERN_LENGTH_LIMIT on the limit of pattern length
1415
TAG_PROC_CWD on the current working directory of the tags generator

Tmain/output-encoding-option.d/run.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ if ${CTAGS} --quiet --options=NONE --list-features | grep -q iconv; then
1313
check_encoding euc-jp
1414
if ${CTAGS} --quiet --options=NONE \
1515
--pseudo-tags=-TAG_PROC_CWD \
16-
--pseudo-tags=-TAG_PROGRAM_VERSION \
16+
--pseudo-tags=-TAG_PROGRAM_VERSION \
1717
--pseudo-tags=-TAG_KIND_DESCRIPTION \
1818
--pseudo-tags=-TAG_FIELD_DESCRIPTION \
1919
--pseudo-tags=-TAG_EXTRA_DESCRIPTION \
2020
--pseudo-tags=-TAG_ROLE_DESCRIPTION \
2121
--pseudo-tags=-TAG_PARSER_VERSION \
22+
--pseudo-tags=-TAG_OUTPUT_VERSION \
2223
--output-encoding=shift_jis --input-encoding=utf-8 --input-encoding-javascript=euc-jp \
2324
-o ${BUILDDIR}/tags \
2425
input.js input.java ; then

Tmain/ptag-kind-sep.d/run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ ${CTAGS} --quiet --options=NONE -o - \
1818
--pseudo-tags=-TAG_EXTRA_DESCRIPTION \
1919
--pseudo-tags=-TAG_ROLE_DESCRIPTION \
2020
--pseudo-tags=-TAG_PARSER_VERSION \
21+
--pseudo-tags=-TAG_OUTPUT_VERSION \
2122
input.php

Tmain/sandbox-crash.d/run.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ is_feature_available ${CTAGS} '!' gcov
1414
{
1515
echo '{"command":"generate-tags", "filename":"input.ctst", "size": 1}'
1616
echo 'P'
17-
} | $CTAGS --quiet --options=NONE --language-force=CTagsSelfTest --_interactive=sandbox \
18-
--pseudo-tags=-TAG_PROGRAM_VERSION
19-
20-
exit $?
17+
} | $CTAGS --quiet --options=NONE --language-force=CTagsSelfTest --_interactive=sandbox > /tmp/ctags-Tmain-$$
18+
r=$?
19+
jdropver < /tmp/ctags-Tmain-$$
20+
rm /tmp/ctags-Tmain-$$
21+
exit $r

0 commit comments

Comments
 (0)