Skip to content

Commit 7199ea4

Browse files
committed
Redesign command programming model
This commit revisits the previous programming model in order to fix several design issues and inconsistencies. The major changes are: - Revisit declarative and programmatic command definition - Redesign command registration and discovery - Introduce new adapters to create commands from annotated methods - Fix incorrect implementation of non-interactive shells #1218 - Remove Shell runner precedence #1219 - Make interactive mode the default #1186 - Remove CommandResolver which is redundant #1217 - Make it easier to use Spring Shell without Spring Boot #1207 - Revisit exceptions I tried to introduce these changes in an incremental way, but APIs were so entangled together that it was very hard to break them down to smaller change sets. This commit does not address Spring Boot support on purpose. Support for Spring Boot will be addressed in a separate commit. Resolves #1186 Resolves #1207 Resolves #1217 Resolves #1218 Resolves #1219
1 parent 1f65aec commit 7199ea4

File tree

117 files changed

+1103
-13477
lines changed

Some content is hidden

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

117 files changed

+1103
-13477
lines changed

pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@
8686

8787
<modules>
8888
<module>spring-shell-core</module>
89-
<module>spring-shell-test</module>
90-
<module>spring-shell-autoconfigure</module>
91-
<module>spring-shell-test-autoconfigure</module>
92-
<module>spring-shell-docs</module>
93-
<module>spring-shell-dependencies</module>
89+
<!-- <module>spring-shell-test</module>-->
90+
<!-- <module>spring-shell-autoconfigure</module>-->
91+
<!-- <module>spring-shell-test-autoconfigure</module>-->
92+
<!-- <module>spring-shell-docs</module>-->
93+
<!-- <module>spring-shell-dependencies</module>-->
9494
<module>spring-shell-samples</module>
95-
<module>spring-shell-starters</module>
95+
<!-- <module>spring-shell-starters</module>-->
9696
</modules>
9797

9898
<build>

spring-shell-core/src/main/java/org/springframework/shell/core/CommandValueProvider.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,9 @@ public CommandValueProvider(CommandRegistry commandRegistry) {
4040

4141
@Override
4242
public List<CompletionProposal> complete(CompletionContext completionContext) {
43-
return commandRegistry.getRegistrations()
44-
.keySet()
43+
return commandRegistry.getCommands()
4544
.stream()
46-
.map(CompletionProposal::new)
45+
.map(command -> new CompletionProposal(command.getName()))
4746
.collect(Collectors.toList());
4847
}
4948

spring-shell-core/src/main/java/org/springframework/shell/core/Input.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public interface Input {
2929

3030
Input EMPTY = () -> "";
3131

32+
Input INTERRUPTED = () -> "";
33+
3234
/**
3335
* Return the input as entered by the user.
3436
*/

0 commit comments

Comments
 (0)