+
+ // If the first arguments do not start with "--" or "-" or is "open" and
+ // is a filename that exists it is probably a file/list of files to open
+ // so we fake an Arg.OPEN argument and when adding files only add the
+ // single arg[i] and increment the defaultLinkedIdCounter so that each of
+ // these files is opened separately.
+ if (initialFilenameArgs && !arg.startsWith(DOUBLEDASH)
+ && !arg.startsWith("-") && new File(arg).exists())
+ {
+ arg = DOUBLEDASH + Arg.OPEN.getName();
+ Console.debug("Adding argument '" + args.get(i)
+ + "' as a file to be opened");
+ }
+ else
+ {
+ initialFilenameArgs = false;
+ }
+