1

An example might be where the arguments to the commandline are -x, -y, and -z. However, if -z is used, then it also requires -a value -b value2, and -c value3. to all be passed and present and there is an optional -d value argument.

I don't see any examples with any kind of complexity like this. Is there an example of how to set up "complex" argument sets where the value of an argument defines later arguments? Or is there a different method of parsing arguments that would be better suited to this?

4

1 回答 1

0

我认为使用 commons-cli 你只能对框架进行简单的解析,它现在不提供高级的可能性。然后,您将在初始解析完成后进行额外的检查,例如您将自己描述为单独步骤的检查。

于 2013-03-21T20:19:00.790 回答