Skip to content
Permalink
Browse files
[CLI-224] Add hasArgs and hasArg method to new Builder.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/cli/trunk@1447088 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
netomi committed Feb 17, 2013
1 parent faa6455 commit 639e070cfe87ea05f3aa618553e7971ccfaec0b7
Showing 1 changed file with 22 additions and 1 deletion.
@@ -931,6 +931,16 @@ public Builder valueSeparator(final char sep)
return this;
}

/**
* Indicates that the Option will require an argument.
*
* @return this builder, to allow method chaining
*/
public Builder hasArg()
{
return hasArg(true);
}

/**
* Indicates if the Option has an argument or not.
*
@@ -943,7 +953,18 @@ public Builder hasArg(final boolean hasArg)
numberOfArgs = hasArg ? 1 : Option.UNINITIALIZED;
return this;
}


/**
* Indicates that the Option can have unlimited argument values.
*
* @return this builder, to allow method chaining
*/
public Builder hasArgs()
{
numberOfArgs = Option.UNLIMITED_VALUES;
return this;
}

/**
* Constructs an Option with the values declared by this {@link Builder}.
*

0 comments on commit 639e070

Please sign in to comment.