Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
o.getValue()返回选项的值。
o.getValue()
但是对于多 arg 输入,例如-h this is a heading,该函数仅返回第一个字符串 ' this ';我如何获取完整的参数:this is a heading。
-h this is a heading
this is a heading
这可能是您的 shell 如何解析命令行的问题。我所知道的所有shell 都将单词分解为单独的参数,并且您需要使用引号来解决这个问题,例如-h "this is a heading" 所有shell 都以这种方式工作,我不相信您可以在Java 中解决这个问题。
-h "this is a heading"