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

Document Global help options with dynamic commands

Open jvalkeal opened this issue 2 years ago • 2 comments
trafficstars

If registering CommandRegistration into a catalog without defining help options like what happens here:

https://github.com/spring-projects/spring-shell/blob/25d249c28dfa37447a3e88bb699afafd3c52107d/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/CommandCatalogAutoConfiguration.java#L72-L76

that command obviously will not get customised. Should find a good way to also customise dynamic commands.

jvalkeal avatar Jan 18 '23 18:01 jvalkeal

I'm leaning towards this being a documentation issue. If manually creating command registrations and then registering those into a catalog where a past beyond a point where shell core can modify given registrations. Currently how these global help options work is that a singleton global instance of a registration builder is prepared for help options and user can choose or not to choose to use it.

For example in samples and how it's documented is that you autowire CommandRegistration.BuilderSupplier which is a global singleton which already knows about these prepared customisations.

jvalkeal avatar Jan 29 '23 14:01 jvalkeal

Reference for this is this commit from spring-cli https://github.com/spring-projects-experimental/spring-cli/commit/cf6cb3b37de05f602aef29672e2df606f93e3bd1

jvalkeal avatar Jan 29 '23 15:01 jvalkeal