This version is still in development and is not considered stable yet. For the latest stable version, please use Spring Shell 3.2.4!

Programmatic

Programmatic way with CommandRegistration is to use withOption to define an option.

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

CommandRegistration can be defined as a bean or manually registered with a CommandCatalog.

Check below sections for other option types, i.e. short format.