Hi guys,
I have just installed Universal ctags using homebrew on OSX, and as I was getting an error with the
--output-format=json
option, so I decided to build it from sources on Debian after cloning the current master branch. But I get the same error :
ctags: unknown output format name supplied for "output-format=json"
when using the command
ctags --output-format=json myfile.c
Everything else seems to work perfectly, so is the JSON output format not supported anymore ?
Have a nice one guys !
I guess libjansson.so, backend library for --output-format=json
, was not available on your PC or not properly linked to your ctags executable.
If the option is available, you can verify it with the other option:
[yamato@slave]$ u-ctags --help | grep -e --output-format
--output-format=u-ctags|e-ctags|etags|xref|json
"json" is included in the help message -of --output-format
.
[yamato@slave]$ u-ctags --list-features
#NAME DESCRIPTION
aspell linked with code for spell checking (internal use)
debug TO BE WRITTEN
iconv can convert input/output encodings
interactive accepts source code from stdin
json supports json format output
option-directory TO BE WRITTEN
regex can use regular expression based pattern matching
sandbox linked with code for system call level sandbox
wildcards can use glob matching
xpath linked with library for parsing xml input
yaml linked with library for parsing yaml input
"json" is included in the output of --list-features
option.
To use the feature, you must install libjansson.so first.
The you must restart the build-procedures from "./configure ...".
If a tool run in the build-process recognizes the installation of libjansson.so properly, you will see follwoing message:
[yamato@slave]~/var/ctags-github% ./configure
...
checking for JANSSON... yes
...
I don't know well Debian (I'm using Fedora daily), however, you can install libjansson as a package.
I guess libjansson-devel or libjansson-dev package is also needed.
It seems that u-ctags debian package is also available.
https://github.com/universal-ctags/ctags/issues/1785
If --output-format=json
of the executable in the binary package doesn't work, let me know.
I will try to fix it with @hnakamur.
@masatake Thank you for your support !
libjansson was indeed missing, so here is what I did :
On Debian, I installed the libjansson-dev
package, then rebuilt from sources using automake :
[user@vps:~/ctags] ~$ sudo apt-get install libjansson-dev && ./autogen.sh && ./configure && make && sudo make install
And it worked properly.
On OSX, I had to use the --with-jansson
option as such :
[user@macosx:~/ctags] ~$ brew install jansson
[user@macosx:~/ctags] ~$ brew install --with-jansson --HEAD universal-ctags/universal-ctags/universal-ctags
Now both binaries show :
[user@vps:~/ctags] ~$ ./ctags --list-features
#NAME DESCRIPTION
[...]
json supports json format output
[...]
Thank you so much for your help mate !
@fabiensabatie FYI, I sent the following merge requests to Debian and they were merged with some tweaks.
Here is the latest Build-Depends
https://salsa.debian.org/debian/universal-ctags/blob/cedf9a1c5106d371398b35031409ae09caecf3e6/debian/control#L5-13
So I think universal-ctags in the next release of Debian will have json support out of the box.
Most helpful comment
I guess libjansson.so, backend library for
--output-format=json
, was not available on your PC or not properly linked to your ctags executable.If the option is available, you can verify it with the other option:
"json" is included in the help message -of
--output-format
."json" is included in the output of
--list-features
option.To use the feature, you must install libjansson.so first.
The you must restart the build-procedures from "./configure ...".
If a tool run in the build-process recognizes the installation of libjansson.so properly, you will see follwoing message:
I don't know well Debian (I'm using Fedora daily), however, you can install libjansson as a package.
I guess libjansson-devel or libjansson-dev package is also needed.
It seems that u-ctags debian package is also available.
https://github.com/universal-ctags/ctags/issues/1785
If
--output-format=json
of the executable in the binary package doesn't work, let me know.I will try to fix it with @hnakamur.