程式設計式

透過 CommandRegistration 的程式設計方式是使用 withOption 來定義一個選項。

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

CommandRegistration 可以定義為一個 bean,也可以手動註冊到 CommandCatalog 中。

請檢視以下章節瞭解其他選項型別,即短格式。
© . This site is unofficial and not affiliated with VMware.