o.getValue()
return the value for the option.
But for a multi arg input, say -h this is a heading
, the function returns only the first string 'this';开发者_如何学运维 how do I fetch the full param: this is a heading
.
This is likely to be an issue with how your shell parses the command line. All shells I know of break up words into separate arguments and you need to use quotes to get around this e.g. -h "this is a heading"
All shells work this way and I don't believe you can get around this in Java.
精彩评论