13 if [[ $arg != -* ]]; then
16 if [[ $arg == --config* ]]; then
19 if [[ $arg == --http ]]; then
24 if [[ $arg == -h ]]; then
28 if [[ $arg == --help ]]; then
32 if [[ $arg == --list ||
$arg == --version ]]; then
38 CP
=/usr
/share
/languagetool
39 for name
in /usr
/share
/java
/languagetool
/*.jar
; do
43 CLI_command
='org.languagetool.commandline.Main'
44 GUI_command
='org.languagetool.gui.Main'
45 NSRV_command
='org.languagetool.server.HTTPServer'
46 SSRV_command
='org.languagetool.server.HTTPSServer'
48 if $asked_for_help; then
49 echo "Command-line interface (CLI) help:"
50 "$JAVA_HOME/bin/java" -cp $CP $CLI_command -h |
sed "s/java -jar languagetool-commandline.jar/languagetool/"
52 echo "Graphical user interface (GUI) help:"
53 "$JAVA_HOME/bin/java" -cp $CP $GUI_command -h |
sed "s/java org.languagetool.gui.Main/languagetool/"
55 echo "HTTP server help:"
56 "$JAVA_HOME/bin/java" -cp $CP $NSRV_command -h |
sed "s/HTTPServer/languagetool --http/"
58 echo "HTTPS server help:"
59 "$JAVA_HOME/bin/java" -cp $CP $SSRV_command -h |
sed "s/HTTPSServer/languagetool/"
61 if $start_server; then
63 "$JAVA_HOME/bin/java" -cp $CP $NSRV_command "${argv[@]}"
65 "$JAVA_HOME/bin/java" -cp $CP $SSRV_command "${argv[@]}"
68 if ( $file_present ||
$force_cli ); then
69 "$JAVA_HOME/bin/java" -cp $CP $CLI_command "${argv[@]}"
71 "$JAVA_HOME/bin/java" -cp $CP $GUI_command "${argv[@]}"