JAL-4277 Corrected choice of all or last opened linkedIds. Better wildcard syntactic...
[jalview.git] / src / jalview / bin / argparser / ArgParser.java
index 947a49e..41189b8 100644 (file)
@@ -505,14 +505,16 @@ public class ArgParser
           if (linkedId == null)
           {
             if (a.hasOption(Opt.OUTPUTFILE) && a.hasOption(Opt.ALLOWMULTIID)
-                    && val.startsWith(MATCHALLLINKEDIDS))
+                    && val.contains(MATCHALLLINKEDIDS))
             {
-              // --output=*.ext is shorthand for --all --output {basename}.ext
+              // --output=*.ext is shorthand for --output {basename}.ext
+              // --output=*/*.ext is shorthand for
+              // --output {dirname}/{basename}.ext
               // (or --image=*.ext)
-              allLinkedIds = true;
-              linkedId = MATCHALLLINKEDIDS;
-              val = LINKEDIDDIRNAME + File.separator + LINKEDIDBASENAME
-                      + val.substring(MATCHALLLINKEDIDS.length());
+              linkedId = allLinkedIds ? MATCHALLLINKEDIDS
+                      : MATCHOPENEDLINKEDIDS;
+              val = FileUtils.convertWildcardsToPath(val, MATCHALLLINKEDIDS,
+                      LINKEDIDDIRNAME, LINKEDIDBASENAME);
             }
             else if (allLinkedIds && a.hasOption(Opt.ALLOWMULTIID))
             {