From: Ben Soares Date: Fri, 16 Jun 2023 19:40:03 +0000 (+0100) Subject: JAL-3830 Take account of --gui taking precedence over --headless X-Git-Tag: Release_2_11_4_0~199^2~8^2~4 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5c1e4c64f0b6befefca853ebb198ddc3bcc253a4;p=jalview.git JAL-3830 Take account of --gui taking precedence over --headless --- diff --git a/src/jalview/bin/Launcher.java b/src/jalview/bin/Launcher.java index f199002..ef50c91 100644 --- a/src/jalview/bin/Launcher.java +++ b/src/jalview/bin/Launcher.java @@ -130,6 +130,7 @@ public class Launcher boolean wait = true; boolean quiet = false; boolean headless = false; + boolean gui = false; // must set --debug before --launcher... boolean launcherstop = false; boolean launcherprint = false; @@ -149,6 +150,10 @@ public class Launcher { headless = true; } + if (arg.equals("--gui")) + { + gui = true; + } if (debug && arg.equals("--launcherprint")) { launcherprint = true; @@ -206,6 +211,11 @@ public class Launcher arguments.add(arg); } } + if (gui) + { + // --gui takes precedence over --headless + headless = false; + } // use saved preferences if no cmdline args boolean useCustomisedSettings = LaunchUtils diff --git a/utils/getdown/bin/jalview.sh b/utils/getdown/bin/jalview.sh index c1ad597..07fd6ed 100755 --- a/utils/getdown/bin/jalview.sh +++ b/utils/getdown/bin/jalview.sh @@ -38,9 +38,12 @@ fi # check for headless mode HEADLESS=0 -for ARG in ARGS; do +for ARG in "${@}"; do if [ "${ARG}" = "--headless" ]; then HEADLESS=1 + elif [ "${ARG}" = "--gui" ]; then + # --gui takes precedence over --headless + HEADLESS=0 break fi done