Skip to content

Commit

Permalink
Added the new group element to the Arg API class.
Browse files Browse the repository at this point in the history
  • Loading branch information
tfenne committed Oct 5, 2017
1 parent 73b3c95 commit f277a8c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/scala/com/fulcrumgenomics/sopt/Sopt.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ object Sopt {
* Represents information about an argument to a command line program.
*
* @param name the name of the argument as presented on the command line
* @param group the (optional) name of the group in which the argument exists
* @param flag the optional flag character for the argument if it has one
* @param kind the name of the type of the argument (for collection arguments, the type in the collection)
* @param minValues the minimum number of values that must be specified
Expand All @@ -71,6 +72,7 @@ object Sopt {
* @param description the description of the argument
*/
case class Arg(name: String,
group: Option[String],
flag: Option[Char],
kind: String,
minValues: Int,
Expand Down Expand Up @@ -103,6 +105,7 @@ object Sopt {
val clpAnn = ParsingUtil.findClpAnnotation(clp).getOrElse(throw new IllegalStateException("No @clp on " + clp.getName))
val args = parser.argumentLookup.ordered.map ( a => Arg(
name = a.longName,
group = a.groupName,
flag = a.shortName,
kind = a.typeName,
minValues = if (a.isCollection) a.minElements else if (a.optional) 0 else 1,
Expand Down

0 comments on commit f277a8c

Please sign in to comment.