JAL-4277 --mkdirs with cautious refusal for paths with ..
[jalview.git] / src / jalview / bin / argparser / Arg.java
index 2bd8e26..9dd5c93 100644 (file)
@@ -68,14 +68,15 @@ public enum Arg
           true, Opt.BOOLEAN, Opt.BOOTSTRAP, Opt.NOACTION, Opt.SECRET),
   P(Type.CONFIG, "Set a Jalview preference value for this session.",
           Opt.PREFIXKEV, Opt.PRESERVECASE, Opt.STRING, Opt.BOOTSTRAP,
-          Opt.MULTIVALUE, Opt.NOACTION, Opt.SECRET), // keep this secret for now.
+          Opt.MULTIVALUE, Opt.NOACTION, Opt.SECRET), // keep this secret for
+                                                     // now.
 
   // Opening an alignment
   OPEN(Type.OPENING,
           "Opens one or more alignment files or URLs in new alignment windows.",
-          Opt.STRING, Opt.LINKED, Opt.INCREMENTDEFAULTCOUNTER, Opt.MULTIVALUE,
-          Opt.GLOB, Opt.ALLOWSUBSTITUTIONS, Opt.INPUT, Opt.STORED,
-          Opt.PRIMARY),
+          Opt.STRING, Opt.LINKED, Opt.INCREMENTDEFAULTCOUNTER,
+          Opt.MULTIVALUE, Opt.GLOB, Opt.ALLOWSUBSTITUTIONS, Opt.INPUT,
+          Opt.STORED, Opt.PRIMARY),
   APPEND(Type.OPENING,
           "Appends one or more alignment files or URLs to the open alignment window (or opens a new alignment if none already open).",
           Opt.STRING, Opt.LINKED, Opt.MULTIVALUE, Opt.GLOB,
@@ -146,8 +147,9 @@ public enum Arg
           Opt.STRING, Opt.LINKED, Opt.MULTIVALUE, Opt.ALLOWMULTIID),
   NOTEMPFAC(Type.STRUCTURE,
           "Do not show the temperature factor annotation for the preceding --structure.",
-          Opt.UNARY, Opt.LINKED, Opt.ALLOWMULTIID, Opt.SECRET), // keep this secret
-                                                            // until it works!
+          Opt.UNARY, Opt.LINKED, Opt.ALLOWMULTIID, Opt.SECRET), // keep this
+                                                                // secret
+  // until it works!
   SHOWSSANNOTATIONS(Type.STRUCTURE, null, Opt.BOOLEAN, Opt.LINKED,
           Opt.ALLOWMULTIID),
 
@@ -224,11 +226,15 @@ public enum Arg
   CLOSE(Type.OPENING,
           "Close the current open alignment window. This occurs after other output arguments. This applies to the current open alignment.  To apply to all ‑‑output and ‑‑image files, use after ‑‑all.",
           Opt.UNARY, Opt.LINKED, Opt.ALLOWMULTIID),
+  MKDIRS(Type.OUTPUT,
+          "Automatically create directories when outputting a file to a new directory.",
+          Opt.UNARY, Opt.LINKED, Opt.ALLOWMULTIID),
 
   // controlling flow of arguments
   NEW(Type.FLOW,
           "Move on to a new alignment window. This will ensure --append will start a new alignment window and other linked arguments will apply to the new alignment window.",
-          Opt.UNARY, Opt.MULTIVALUE, Opt.NOACTION, Opt.INCREMENTDEFAULTCOUNTER),
+          Opt.UNARY, Opt.MULTIVALUE, Opt.NOACTION,
+          Opt.INCREMENTDEFAULTCOUNTER),
   SUBSTITUTIONS(Type.FLOW,
           "The following argument values allow (or don't allow) subsituting filename parts. This is initially true. Valid substitutions are:\n"
                   + "{basename} - the filename-without-extension of the currently --opened file (or first --appended file),\n"
@@ -269,7 +275,8 @@ public enum Arg
           "Allow specific stdout information.  For testing purposes only.",
           Opt.UNARY, Opt.BOOTSTRAP, Opt.SECRET), // do not show this to the user
   SETPROP(Type.CONFIG, "Set an individual Java System property.",
-          Opt.STRING, Opt.MULTIVALUE, Opt.BOOTSTRAP, Opt.SECRET), // not in use yet
+          Opt.STRING, Opt.MULTIVALUE, Opt.BOOTSTRAP, Opt.SECRET), // not in use
+                                                                  // yet
   NIL(Type.FLOW,
           "This argument does nothing on its own, but can be used with linkedIds.",
           Opt.UNARY, Opt.LINKED, Opt.MULTIVALUE, Opt.NOACTION, Opt.SECRET),