Skip to content

Commit 91d355c

Browse files
nhomblejvalkeal
authored andcommitted
expose words for end users to take some default action
- Fixes #293 - Polished PR #294
1 parent 52ff4a2 commit 91d355c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.shell;
1818

19+
import java.util.ArrayList;
1920
import java.util.List;
2021
import java.util.stream.Collectors;
2122

@@ -34,4 +35,13 @@ public CommandNotFound(List<String> words) {
3435
public String getMessage() {
3536
return String.format("No command found for '%s'", words.stream().collect(Collectors.joining(" ")));
3637
}
38+
39+
/**
40+
* Gets a {@code words} in this exception.
41+
*
42+
* @return a words
43+
*/
44+
public List<String> getWords(){
45+
return new ArrayList<>(words);
46+
}
3747
}

0 commit comments

Comments
 (0)