FS#68079 - [languagetool] make it possible to run command-line without passing a file path

Attached to Project: Community Packages
Opened by Enno (konfekt) - Friday, 02 October 2020, 18:49 GMT
Last edited by Antonio Rojas (arojas) - Thursday, 27 April 2023, 18:28 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Antonio Rojas (arojas)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

As the source code at https://github.com/archlinux/svntogit-community/blob/9b4884d4d6e48ca5578e42468ea9c3024538d803/trunk/languagetool.sh#L11 shows, the GUI is started if a file path is not passed as an argument. However, for example listing all available languages by `--list` is expected to output all available languages on the command-line. Therefore, an executable should be added to run languagetool on the command-line to achieve this output.

Steps to reproduce:

Run `languagetool --list`.

Expected: the list of all available languages on the command-line.

Instead, the GUI is openend.
This task depends upon

Closed by  Antonio Rojas (arojas)
Thursday, 27 April 2023, 18:28 GMT
Reason for closing:  Fixed
Additional comments about closing:  languagetool 6.1-2
Comment by Enno (konfekt) - Saturday, 03 October 2020, 08:31 GMT
Apparently, referring to https://github.com/Konfekt/vim-langtool/issues/3#issuecomment-702919525

the missing output of `--list` is due to the error

Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-14-openjdk/lib/libawt_xawt.so
Comment by Gena (Shatur) - Monday, 05 October 2020, 08:37 GMT
> the missing output of `--list` is due to the error

I figured out that I need to install the jre-openjdk package to fix the crash. And yes, after that the GUI starts up :(
Comment by Gena (Shatur) - Monday, 05 October 2020, 08:38 GMT
Probably `jre-openjdk` should be added as dependency.
Comment by Gena (Shatur) - Monday, 05 October 2020, 17:54 GMT
Oh, sorry, it already contains `java-runtime` dependency.
Comment by Andrzej Giniewicz (Giniu) - Wednesday, 07 October 2020, 17:00 GMT
Thanks for finding out, I will add support for --list to startup script.
Comment by Cristóbal (tapia) - Sunday, 03 October 2021, 12:10 GMT
Hi, we came across this problem when using the languagetool script in the vimtex plugin [1]. Has there been any progress in solving this issue? The vimtex plugin relies on the output of `languagetool --list`, as it was expected to work similar as `java -jar languagetool-commandline.jar`. The workaround now is to just pass any file (even a non-existing file will do). However, it would still be cool if the script would work as expected.

Thanks!

[1] https://github.com/lervag/vimtex/issues/2190
Comment by Ricardo (MithicSpirit) - Saturday, 11 March 2023, 04:53 GMT
This also causes issues with checking the --version (as that switch is only available in the CLI). The script should add a list of flags that force CLI mode even if a file is provided. Alternatively, there could be another script (named languagetool-cli) provided that always uses the CLI instead of the GUI.

Loading...