我使用Apache Commons CLI来分析命令行参数。Apache Commons CLI中-help选项的多个参数值名称
我正在寻找一种方法来显示帮助中的多个参数值名称。 下面是选项 “startimport” 的一个参数的例子:
Option startimport = OptionBuilder
.withArgName("environment")
.hasArg()
.withDescription(
"Description")
.create("startimport");
当我使用-help它打印出:
-startimport <environment> Description
Thatfs罚款。但是如果我想用两个参数呢?
Option startimport = OptionBuilder
.withArgName("firstArg secondArg")
.hasArgs(2)
.withDescription("Description")
.create("startimport ");
解析两个参数是没有问题的,但我想在 “-help” 以下的输出:
startimport <firstArg> <secondArg> Description
但是目前,我只想得到:
startimport <firstArg secondArg> Description
是有那个问题的适当的解决方案?