From 5c1e4c64f0b6befefca853ebb198ddc3bcc253a4 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Fri, 16 Jun 2023 20:40:03 +0100 Subject: [PATCH] JAL-3830 Take account of --gui taking precedence over --headless --- src/jalview/bin/Launcher.java | 10 ++++++++++ utils/getdown/bin/jalview.sh | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) 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 -- 1.7.10.2