Java Apache Commons CLI,重复选项 - 需要最后输入的参数
我刚从Java的Apache Commons CLI开始,可以有重复的CLI选项。 Apache Commons会自动处理吗?
前任。 (程序-W arg 1 arg2 -w arg1 arg2)。
我需要分配给选项-W的最后一对args。 Apache Commons是否会自动覆盖重复选项的args?
I'm just starting out with apache commons CLI in Java and could have CLI options which are repeated. Does apache commons automatically process?
Ex. (program -w arg 1 arg2 -w arg1 arg2).
I need the last pair of args assigned to option -w. Does apache commons automatically overwrite the args for repeated options?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Apache Common在第一个选项/参数中取决于循环。
只需将两个用于循环,将'j'at on j'y at'i'的元素进行比较,返回'j'and和element在'j+1'的元素
上述代码打印,
这是您的重复选项,w/grogn
Apache common takes in the first option/argument unless looped over.
Just use two for loops, compare element at 'j' with element at 'i', return the element at 'j' and and element at 'j+1'
The above code prints
which is your repeated option w/argument