From: Ben Soares Date: Thu, 30 Mar 2023 13:10:57 +0000 (+0100) Subject: JAL-629 Don't use new ArgParser if there are no --args and some -args X-Git-Tag: Release_2_11_4_0~415 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=924e301712fbc74e517e9a633f9e00c38b646aff;p=jalview.git JAL-629 Don't use new ArgParser if there are no --args and some -args --- diff --git a/src/jalview/bin/argparser/ArgParser.java b/src/jalview/bin/argparser/ArgParser.java index e58bcb5..54f57fe 100644 --- a/src/jalview/bin/argparser/ArgParser.java +++ b/src/jalview/bin/argparser/ArgParser.java @@ -115,6 +115,27 @@ public class ArgParser public ArgParser(List args) { + // do nothing if there are no "--" args and some "-" args + boolean d = false; + boolean dd = false; + for (String arg : args) + { + if (arg.startsWith(DOUBLEDASH)) + { + dd = true; + break; + } + else if (arg.startsWith("-")) + { + d = true; + } + } + if (d && !dd) + { + // leave it to the old style -- parse an empty list + parse(new ArrayList()); + return; + } parse(args); }