X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2Fargparser%2FBootstrapArgs.java;h=ec62bcdf3a50902878de66633d4e8af56052aa96;hb=fd814da2180509657dbc6a644cf3e812e8e00c92;hp=f51e4c5b1a408a6901c110176ec4e5bb5867074e;hpb=3778008766299b5db71d77e8530a9c0fe9b6916d;p=jalview.git diff --git a/src/jalview/bin/argparser/BootstrapArgs.java b/src/jalview/bin/argparser/BootstrapArgs.java index f51e4c5..ec62bcd 100644 --- a/src/jalview/bin/argparser/BootstrapArgs.java +++ b/src/jalview/bin/argparser/BootstrapArgs.java @@ -28,6 +28,8 @@ public class BootstrapArgs private Set argsTypes = new HashSet<>(); + private boolean outputToStdout = false; + public static BootstrapArgs getBootstrapArgs(String[] args) { List argList = new ArrayList<>(Arrays.asList(args)); @@ -53,7 +55,7 @@ public class BootstrapArgs { if (argFiles.contains(inArgFile)) { - System.err.println( + jalview.bin.Console.errPrintln( "Looped argfiles detected: '" + inArgFile.getPath() + "'"); return; } @@ -127,11 +129,6 @@ public class BootstrapArgs } } - if (ArgParser.argMap.containsKey(argName) && val == null) - { - val = "true"; - } - Arg a = ArgParser.argMap.get(argName); if (a != null) @@ -152,7 +149,27 @@ public class BootstrapArgs if (a == null || !a.hasOption(Opt.BOOTSTRAP)) { - // not a valid bootstrap arg + // not a bootstrap arg + + // make a check for an output going to stdout + if (a != null && a.hasOption(Opt.OUTPUTFILE) + && a.hasOption(Opt.STDOUT)) + { + if (val == null && i + 1 < args.size()) + { + val = args.get(i + 1); + } + if (val.startsWith("[") && val.indexOf(']') > 0) + { + val = val.substring(val.indexOf(']') + 1); + } + + if (ArgParser.STDOUTFILENAME.equals(val)) + { + this.outputToStdout = true; + } + } + continue; } @@ -188,6 +205,11 @@ public class BootstrapArgs } else { + if (val == null) + { + val = "true"; + } + add(a, type, val); } } @@ -373,4 +395,9 @@ public class BootstrapArgs } return isHeadless; } + + public boolean outputToStdout() + { + return this.outputToStdout; + } }