2727import org .springframework .context .annotation .Bean ;
2828import org .springframework .shell .core .MethodTargetRegistrar ;
2929import org .springframework .shell .boot .SpringShellProperties .Help ;
30+ import org .springframework .shell .core .command .Command ;
3031import org .springframework .shell .core .command .CommandRegistry ;
3132import org .springframework .shell .core .command .CommandRegistryCustomizer ;
32- import org .springframework .shell .core .command .CommandRegistration ;
33- import org .springframework .shell .core .command .CommandRegistration .BuilderSupplier ;
34- import org .springframework .shell .core .command .CommandRegistration .OptionNameModifier ;
33+ import org .springframework .shell .core .command .BuilderSupplier ;
34+ import org .springframework .shell .core .command .OptionNameModifier ;
3535import org .springframework .shell .core .command .support .OptionNameModifierSupport ;
3636import org .springframework .shell .core .command .CommandResolver ;
3737import org .springframework .shell .core .context .ShellContext ;
@@ -57,8 +57,7 @@ public CommandRegistry commandRegistry(ObjectProvider<MethodTargetRegistrar> met
5757 }
5858
5959 @ Bean
60- public CommandRegistryCustomizer defaultCommandRegistryCustomizer (
61- ObjectProvider <CommandRegistration > commandRegistrations ) {
60+ public CommandRegistryCustomizer defaultCommandRegistryCustomizer (ObjectProvider <Command > commandRegistrations ) {
6261 return registry -> {
6362 commandRegistrations .orderedStream ().forEach (registration -> {
6463 registry .register (registration );
@@ -71,11 +70,10 @@ public CommandRegistrationCustomizer helpOptionsCommandRegistrationCustomizer(Sp
7170 return registration -> {
7271 Help help = properties .getHelp ();
7372 if (help .isEnabled ()) {
74- registration .withHelpOptions ()
75- .enabled (true )
73+ registration .withHelpOptions (helpOptionsSpec -> helpOptionsSpec .enabled (true )
7674 .longNames (help .getLongNames ())
7775 .shortNames (help .getShortNames ())
78- .command (help .getCommand ());
76+ .command (help .getCommand ())) ;
7977 }
8078 };
8179 }
@@ -121,7 +119,7 @@ public CommandRegistrationCustomizer defaultOptionNameModifierCommandRegistratio
121119 public BuilderSupplier commandRegistrationBuilderSupplier (
122120 ObjectProvider <CommandRegistrationCustomizer > customizerProvider ) {
123121 return () -> {
124- CommandRegistration .Builder builder = CommandRegistration .builder ();
122+ Command .Builder builder = Command .builder ();
125123 customizerProvider .orderedStream ().forEach ((customizer ) -> customizer .customize (builder ));
126124 return builder ;
127125 };
0 commit comments