JAL-629 allow opening URL as only argument(s)
authorBen Soares <b.soares@dundee.ac.uk>
Thu, 27 Apr 2023 14:23:19 +0000 (15:23 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Thu, 27 Apr 2023 14:23:19 +0000 (15:23 +0100)
src/jalview/bin/argparser/ArgParser.java

index 0ab5987..d5e3bff 100644 (file)
@@ -37,6 +37,7 @@ import jalview.bin.Console;
 import jalview.bin.Jalview;
 import jalview.bin.argparser.Arg.Opt;
 import jalview.util.FileUtils;
+import jalview.util.HttpUtils;
 
 public class ArgParser
 {
@@ -197,7 +198,8 @@ public class ArgParser
       // single arg[i] and increment the defaultLinkedIdCounter so that each of
       // these files is opened separately.
       if (openEachInitialFilenames && !arg.startsWith(DOUBLEDASH)
-              && !arg.startsWith("-") && new File(arg).exists())
+              && !arg.startsWith("-") && (new File(arg).exists()
+                      || HttpUtils.startsWithHttpOrHttps(arg)))
       {
         arg = Arg.OPEN.argString();
       }