此版本仍在开发中,尚未被视为稳定版本。对于最新的稳定版本,请使用 Spring Shell 3.3.0Spring中文文档

此版本仍在开发中,尚未被视为稳定版本。对于最新的稳定版本,请使用 Spring Shell 3.3.0Spring中文文档

Option Label 在 shell 本身中没有功能行为,除了 默认命令输出的内容。在命令文档中 记录了一种选项,但这并不总是非常有用。因此 您可能希望为选项提供更好的描述性词语。helpSpring中文文档

不支持 Label。legacy annotation
不支持 Label。legacy annotation
CommandRegistration labelOption() {
	return CommandRegistration.builder()
		.withOption()
			.longNames("arg")
			.label("MYLABEL")
			.and()
		.build();
}
void labelOption(
	@Option(label = "MYLABEL") String arg
) {
}

然后,定义标签显示在 中。helpSpring中文文档

my-shell:>help labelOption
NAME
       labelOption -

SYNOPSIS
       labelOption --arg MYLABEL

OPTIONS
       --arg MYLABEL
       [Optional]