嘿,我正在使用Jcommander库来解析命令行参数。我的问题是 Jcommander 生成的使用消息的格式。这是使用函数的输出:
Usage: mvnUploader [options]
Options:
* -d, --directory
the directory of the artifacts to upload
-h, --help
print help message
我希望选项和描述在同一行
我的 args 类:
public class OptionalArgs {
@Parameter(names = {"-d", "--directory"}, required = true, description =
"the directory of the artifacts to upload")
private String pathToArtifacts;
@Parameter(names ={"-h", "--help"} , help = true, description = "print help
message")
private boolean help = false;
public String getPathToArtifacts() {
return pathToArtifacts;
}
public boolean isHelp() {
return help;
}
}