Hello,
> So, I suspect that the -f parameter is only effective for C/C++ language
files.
I don't think that's the case. In my environment, I get the following
results:
---------------------------------------------------------------
$ cat test.sh
test1() {
echo "test1"
}
test1
$ cat test.py
def test2():
print("test2")
test2()
$ gtags
$ global -f test.sh
test1 1 test.sh test1() {
$ global -f test.py
test2 1 test.py def test2():
$ cat gtags.conf
default:\
:ctagscom=/usr/local/bin/ctags:\
:ctagslib=$libdir/gtags/universal-ctags.la:\
:langmap=Python\:.py.pyx.pxd.pxi.scons:\
:langmap=Sh\:.sh.SH.bsh.bash.ksh.zsh.ash:\
:gtags_parser=Python\:$ctagslib:\
:gtags_parser=Sh\:$ctagslib:
---------------------------------------------------------------
Could you please try running gtags(1) with the -v option?
Perhaps .sh and .py files are not being recognized as source code?
Regards,
Shigio
On Thu, May 8, 2025 at 5:42 PM agen <[email protected]> wrote:
> Case:
>
> ~/aaa$ global -xa main
> main 3 /home/cstor/aaa/test.cc int main () {
> main 1 /home/cstor/aaa/test1.c int main()
> main 1 /home/cstor/aaa/test2.sh function main () {
> main 1 /home/cstor/aaa/test3.py def main():
> ~/aaa$
> ~/aaa$
> ~/aaa$ global -xaf test.cc
> main 3 /home/cstor/aaa/test.cc int main () {
> ~/aaa$
> ~/aaa$ global -xaf test3.py
> ~/aaa$
> ~/aaa$global -xaf test2.sh
> ~/aaa$
>
>
> As can be seen above:
>
> - The *global -xa main* command can find all files containing the main
> symbol, which means there is no problem with the *gtags* command when
> generating symbols.
> - The *global -xaf test.cc* command can display all the symbols in the
> test.cc file.
> - The outputs of both *global -xaf test3.py* and *global -xaf test2.sh* are
> empty.
>
>
> So, I suspect that the *-f* parameter is only effective for C/C++
> language files.
>
--
Shigio YAMAGUCHI <[email protected]>
PGP fingerprint:
26F6 31B4 3D62 4A92 7E6F 1C33 969C 3BE3 89DD A6EB