@@ -46,28 +46,28 @@ public abstract class AbstractConsoleArgument extends
4646 AbstractHandlerPlugin <LinkedList <String >> implements ConsoleArgument
4747{
4848 private int numArgs ;
49- private Set <String > aliasFlags ;
49+ private Set <String > flags ;
5050
5151 public AbstractConsoleArgument () {
5252 this (1 , new String [0 ]);
5353 }
5454
55- public AbstractConsoleArgument (final String ... aliases ) {
56- this (1 , aliases );
55+ public AbstractConsoleArgument (final String ... flags ) {
56+ this (1 , flags );
5757 }
5858
59- public AbstractConsoleArgument (final int requiredArgs , final String ... aliases ) {
59+ public AbstractConsoleArgument (final int requiredArgs , final String ... flags ) {
6060 numArgs = requiredArgs ;
61- aliasFlags = new HashSet <String >();
62- for (final String s : aliases ) aliasFlags .add (s );
61+ this . flags = new HashSet <String >();
62+ for (final String s : flags ) this . flags .add (s );
6363 }
6464
6565 // -- Typed methods --
6666
6767 @ Override
6868 public boolean supports (final LinkedList <String > args ) {
6969 if (args == null || args .size () < numArgs ) return false ;
70- return isAlias (args );
70+ return isFlag (args );
7171 }
7272
7373 @ Override
@@ -77,11 +77,13 @@ public Class<LinkedList<String>> getType() {
7777 }
7878
7979 /**
80- * @return true if there are no aliases for this {@code ConsoleArgument}, or
81- * at least one alias matches the first argument in the provided
82- * list
80+ * Check if the given list of arguments starts with a flag that matches this
81+ * {@link ConsoleArgument}.
82+ *
83+ * @return true iff one of this argument's flags matches the first string in
84+ * the given list, or this argument has no explicit flags.
8385 */
84- protected boolean isAlias (final LinkedList <String > args ) {
85- return aliasFlags .isEmpty () || aliasFlags .contains (args .getFirst ());
86+ protected boolean isFlag (final LinkedList <String > args ) {
87+ return flags .isEmpty () || flags .contains (args .getFirst ());
8688 }
8789}
0 commit comments