Default Value

Having a default value for an option is somewhat related to Optional Value, as there are cases where you may want to know if the user defined an option and change behavior based on a default value:spring-doc.cn

CommandRegistration defaultOption() {
	return CommandRegistration.builder()
		.command("defaultOption")
		.withOption()
			.longNames("arg")
			.defaultValue("default")
			.and()
		.build();
}
void defaultOption(
	@Option(defaultValue = "default") String arg
) {
}
void defaultOption(
	@ShellOption(defaultValue = "default") String arg
) {
}