for (int i = 0; i < args.length; i++)
{
String arg = args[i].trim();
- if (arg.charAt(0) == '-')
+ if (arg.length() > 0 && arg.charAt(0) == '-')
{
arg = arg.substring(1);
}
System.setSecurityManager(null);
}
- if (args == null)
+ if (args == null || args.length == 0 || (args.length == 1
+ && (args[0] == null || args[0].length() == 0)))
+ {
args = new String[] {};
+ }
// get args needed before proper ArgParser
bootstrapArgs = BootstrapArgs.getBootstrapArgs(args);
$CONSOLEWIDTH = $Host.UI.RawUI.WindowSize.Width
# quote the args and the command (in case of spaces) with escape chars (`) and precede with & to indicate command not string
-$myArgsString = '"' + $($myArgs -join '" "') + '"'
-Invoke-Expression -Command "& `"${JAVA}`" `"-DCONSOLEWIDTH=${CONSOLEWIDTH}`" -cp `"${CLASSPATH}`" jalview.bin.Launcher ${myArgsString}"
+if ( $myArgs.count -eq 0 ) {
+ Invoke-Expression -Command "& `"${JAVA}`" `"-DCONSOLEWIDTH=${CONSOLEWIDTH}`" -cp `"${CLASSPATH}`" jalview.bin.Launcher"
+} else {
+ $myArgsString = '"' + $($myArgs -join '" "') + '"'
+ Invoke-Expression -Command "& `"${JAVA}`" `"-DCONSOLEWIDTH=${CONSOLEWIDTH}`" -cp `"${CLASSPATH}`" jalview.bin.Launcher ${myArgsString}"
+}