Java commons cli with options for a list of possible values

Xinxin banner Xinxin 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new 200 new

$java -jar Mumu.jar -a foo
OK
$java -jar Mumu.jar -a bar
OK
$java -jar Mumu.jar -a foobar
foobar is not a valid value for -a

Solution

Since commons cli is not directly supported, the simplest solution may be to check the value of the option when getting the option

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>