编程式

通过 CommandRegistration 的编程方式是使用 withOption 来定义一个选项。

CommandRegistration registration = CommandRegistration.builder()
	.withOption()
		.longNames("arg1")
		.and()
	.build();

CommandRegistration 可以定义为一个 bean,也可以手动注册到 CommandCatalog 中。

请查看以下章节了解其他选项类型,即短格式。
© . This site is unofficial and not affiliated with VMware.