boolean debug = false;
boolean wait = true;
boolean quiet = false;
+ boolean stdout = false;
// must set --debug before --launcher...
boolean launcherstop = false;
boolean launcherprint = false;
boolean launcherwait = false;
ArrayList<String> arguments = new ArrayList<>();
+ String previousArg = null;
for (String arg : args)
{
if (arg.equals("--debug"))
{
quiet = true;
}
+ if (arg.equals("--output=-")
+ || (arg.equals("-") && "--output".equals(previousArg)))
+ {
+ stdout = true;
+ }
if (debug && arg.equals("--launcherprint"))
{
launcherprint = true;
{
wait = false;
}
+ previousArg = arg;
// Don't add the --launcher... args to Jalview launch
if (arg.startsWith("--launcher"))
{
String scalePropertyArg = HiDPISetting.getScalePropertyArg();
if (scalePropertyArg != null)
{
- sysout(debug, quiet, "Running " + startClass + " with scale setting "
+ syserr(debug, quiet, "Running " + startClass + " with scale setting "
+ scalePropertyArg);
command.add(scalePropertyArg);
}
if ((Boolean.parseBoolean(System.getProperty("launcherprint", "false"))
|| launcherprint))
{
- sysout(debug, quiet,
+ syserr(debug, quiet,
"LAUNCHER COMMAND: " + String.join(" ", builder.command()));
}
- sysout(debug, quiet,
+ syserr(debug, quiet,
"Running " + startClass + " with "
+ (memSetting == null ? "no memory setting"
: ("memory setting " + memSetting)));
if (Boolean.parseBoolean(System.getProperty("launcherstop", "false"))
|| (debug && launcherstop))
{
- sysout(debug, quiet,
+ syserr(debug, quiet,
"System property 'launcherstop' is set and not 'false'. Exiting.");
System.exit(0);
}
Process process = builder.start();
if (wait || launcherwait)
{
- sysout(debug, quiet, "Launching application process");
+ syserr(debug, quiet, "Launching application process");
process.waitFor();
}
else
{
int waitInt = 0;
- sysout(debug, quiet,
+ syserr(debug, quiet,
"Wait time for application process is " + waitInt + "ms");
process.waitFor(waitInt, TimeUnit.MILLISECONDS);
}
- sysout(debug, quiet, "Launcher process ending");
+ syserr(debug, quiet, "Launcher process ending");
} catch (IOException e)
{
if (e.getMessage().toLowerCase(Locale.ROOT).contains("memory"))
}
}
- private static void sysout(boolean debug, boolean quiet, String message)
+ private static void syserr(boolean debug, boolean quiet, String message)
{
if (debug && !quiet)
{
- System.out.println("LAUNCHERDEBUG - " + message);
+ System.err.println("LAUNCHERDEBUG - " + message);
}
}