1
我得到一個類型爲apache.commons.cli.CommandLine的對象通過。不知何故,沒有toString()方法(org.apache.commons.exec.CommandLine沒有toString()方法)。Get apache.commons.cli.CommandLine as String
是否有可能將原始命令行作爲String?
我得到一個類型爲apache.commons.cli.CommandLine的對象通過。不知何故,沒有toString()方法(org.apache.commons.exec.CommandLine沒有toString()方法)。Get apache.commons.cli.CommandLine as String
是否有可能將原始命令行作爲String?
不,從CommandLine對象返回原始輸入參數是不可能的。 CommandLine
對象只存儲解析器從輸入參數列表中解析出的內容。
如果您確實需要確切的參數列表,您提供解析器保存對您傳遞給解析器的String[]
的引用。
太糟糕了,但感謝您的信息! – Beginner