expose words for end users to take some default action

- Fixes #293
- Polished PR #294
This commit is contained in:
nicolas
2019-12-17 23:11:33 -05:00
committed by Janne Valkealahti
parent 52ff4a2d85
commit 91d355cb26

View File

@@ -16,6 +16,7 @@
package org.springframework.shell;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@@ -34,4 +35,13 @@ public class CommandNotFound extends RuntimeException {
public String getMessage() {
return String.format("No command found for '%s'", words.stream().collect(Collectors.joining(" ")));
}
/**
* Gets a {@code words} in this exception.
*
* @return a words
*/
public List<String> getWords(){
return new ArrayList<>(words);
}
}