mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-05-02 19:30:23 +01:00
Add basic Banner to CLI Shell
This commit is contained in:
@@ -44,6 +44,8 @@ public class ShellCommand extends AbstractCommand {
|
|||||||
final PrintStream sysout = System.out;
|
final PrintStream sysout = System.out;
|
||||||
final PrintStream syserr = System.err;
|
final PrintStream syserr = System.err;
|
||||||
|
|
||||||
|
printBanner();
|
||||||
|
|
||||||
System.setIn(console.getInput());
|
System.setIn(console.getInput());
|
||||||
PrintStream out = new PrintStream(new OutputStream() {
|
PrintStream out = new PrintStream(new OutputStream() {
|
||||||
@Override
|
@Override
|
||||||
@@ -161,6 +163,13 @@ public class ShellCommand extends AbstractCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void printBanner() {
|
||||||
|
String version = ShellCommand.class.getPackage().getImplementationVersion();
|
||||||
|
version = (version == null ? "" : " (v" + version + ")");
|
||||||
|
System.out.println("Spring Boot CLI" + version);
|
||||||
|
System.out.println("Hit TAB to complete. Type 'help' and hit RETURN for help.");
|
||||||
|
}
|
||||||
|
|
||||||
public void pushPrompt(String prompt) {
|
public void pushPrompt(String prompt) {
|
||||||
this.prompts.push(this.prompt);
|
this.prompts.push(this.prompt);
|
||||||
this.prompt = prompt;
|
this.prompt = prompt;
|
||||||
|
|||||||
Reference in New Issue
Block a user