Skip to content

Commit 0123947

Browse files
committed
Introduce new command DSL
Signed-off-by: Piotr Olaszewski <piotr.olaszewski@thulium.pl>
1 parent 328f23a commit 0123947

File tree

59 files changed

+1657
-2823
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1657
-2823
lines changed

spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/CommandRegistryAutoConfiguration.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,10 @@ public CommandRegistrationCustomizer helpOptionsCommandRegistrationCustomizer(Sp
7171
return registration -> {
7272
Help help = properties.getHelp();
7373
if (help.isEnabled()) {
74-
registration.withHelpOptions()
75-
.enabled(true)
74+
registration.withHelpOptions(helpOptionsSpec -> helpOptionsSpec.enabled(true)
7675
.longNames(help.getLongNames())
7776
.shortNames(help.getShortNames())
78-
.command(help.getCommand());
77+
.command(help.getCommand()));
7978
}
8079
};
8180
}

spring-shell-autoconfigure/src/test/java/org/springframework/shell/boot/CommandRegistryAutoConfigurationTests.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,7 @@ static class CustomCommandRegistrationConfiguration {
165165
CommandRegistration commandRegistration() {
166166
return CommandRegistration.builder()
167167
.command("customcommand")
168-
.withTarget()
169-
.function(ctx -> null)
170-
.and()
168+
.withTarget(targetSpec -> targetSpec.function(ctx -> null))
171169
.build();
172170
}
173171

0 commit comments

Comments
 (0)