Added FileParameters type.
[svjatoslav_commons.git] / src / main / java / eu / svjatoslav / commons / commandline / parameterparser / Parameter.java
index 32e9594..8208583 100755 (executable)
@@ -11,13 +11,14 @@ package eu.svjatoslav.commons.commandline.parameterparser;
 
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.List;
 
 public abstract class Parameter<T, I extends Parameter> {
 
     public final String description;
-    public final ArrayList<String> arguments = new ArrayList<>();
+    public final List<String> arguments = new ArrayList<>();
     final ArgumentCount argumentCount;
-    private final ArrayList<String> aliases = new ArrayList<>();
+    private final List<String> aliases = new ArrayList<>();
     /**
      * Indicates that at least one argument is mandatory for this parameter.
      */
@@ -116,7 +117,11 @@ public abstract class Parameter<T, I extends Parameter> {
         // first line
         buffer.append(getAliases());
         if (!argumentCount.equals(ArgumentCount.NONE)) {
-            buffer.append(" (" + describeFormat() + ")");
+            buffer
+                    .append(" (")
+                    .append(isMandatory() ? "mandatory, " : "")
+                    .append(describeFormat())
+                    .append(")");
 
             if (argumentCount.equals(ArgumentCount.MULTI))
                 buffer.append("...");