在Java中使用SimpleJSAP时参数的默认值

时间:2013-07-26 06:58:14

标签: java

这是我的命令行参数之一:

 new FlaggedOption("nrMaxIterations", JSAP.INTEGER_PARSER, null, JSAP.NOT_REQUIRED, JSAP.NO_SHORTFLAG,    "nrMaxIterations", "Maximum pool iterations to run")

即使我将其设置为不需要参数,正如您在传递的第三个值中看到的那样, 我仍然得到错误:

exception: com.martiansoftware.jsap.UnspecifiedParameterException: Parameter 'nrMaxIterations' has no associated value.

这不应该发生,我设置参数不是必需的,但无论出于何种原因,它都按要求行事。

由于

0 个答案:

没有答案