From cc8aa753daa8aa1a9d980b2d7a43344ada8ef161 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Mon, 23 Dec 2013 17:49:50 +0000 Subject: [PATCH] Add basic Banner to CLI Shell --- .../springframework/boot/cli/command/ShellCommand.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/ShellCommand.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/ShellCommand.java index b2c268cbea..b676e0090a 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/ShellCommand.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/ShellCommand.java @@ -44,6 +44,8 @@ public class ShellCommand extends AbstractCommand { final PrintStream sysout = System.out; final PrintStream syserr = System.err; + printBanner(); + System.setIn(console.getInput()); PrintStream out = new PrintStream(new OutputStream() { @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) { this.prompts.push(this.prompt); this.prompt = prompt;