spring-shell icon indicating copy to clipboard operation
spring-shell copied to clipboard

CommandAvailability is not documented

Open The4thLaw opened this issue 1 year ago • 1 comments
trafficstars

The documentation at https://docs.spring.io/spring-shell/reference/commands/availability.html explains how one can achieve dynamic command availability.

However, it seems that the documented annotation is only applicable on @ShellMethod commands, i.e. using the legacy annotations.

The new @Command-based methods should apparently use @CommandAvailability and rely on the AvailabilityProvider functional interface.

Perhaps the documentation should, also in this case, make a distinction between legacy and recommended annotations.

The4thLaw avatar Apr 22 '24 07:04 The4thLaw

You're right about this. That section indeed feels confusing and not clear.

jvalkeal avatar Apr 29 '24 09:04 jvalkeal