资 源 简 介
parse-cmd
ParseCmd.java is a Java-class used to define and parse command-line parameters in a Java application.
See ParseParms.scala for an equivalent implementation using Scala
It facilitates the definition of parameters, each including the following values:
* name
* default value
* regular-expression used for validation
* error/help information
* flag to indicate whether the named parameter is required; defaults to optional
Here is a sample statement defining a required parameter, req(), named "-ifile", with a default value of "input.txt", and including a message should validation fail, msg(" ... ")
.parm("-ifile", "input.txt").req().msg("enter a valid file name")
Why
Several Java-based command-line parsing solutions are available