Programmatic

使用 CommandRegistration 的编程方式是使用 withOption 定义选项。

link:../../../../../src/test/java/org/springframework/shell/docs/OptionSnippets.java[role=include]

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

查看以下部分以了解其他选项类型,即短格式。