开发者

Rreading a multi string argument using Apache commons

开发者 https://www.devze.com 2023-02-19 22:21 出处:网络
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:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号