From 924e301712fbc74e517e9a633f9e00c38b646aff Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Thu, 30 Mar 2023 14:10:57 +0100 Subject: [PATCH] JAL-629 Don't use new ArgParser if there are no --args and some -args --- src/jalview/bin/argparser/ArgParser.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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); } -- 1.7.10.2