geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r726058 - in /geronimo/gshell/trunk: gshell-application/src/main/java/org/apache/geronimo/gshell/application/model/ gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/branding/ gshell-wisdom/gshell-wisdom-...
Date Fri, 12 Dec 2008 15:52:06 GMT
Author: jdillon
Date: Fri Dec 12 07:52:05 2008
New Revision: 726058

URL: http://svn.apache.org/viewvc?rev=726058&view=rev
Log:
Make the default prompt part of Branding

Modified:
    geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/model/Branding.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/branding/GShellBranding.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandSupport.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java

Modified: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/model/Branding.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/model/Branding.java?rev=726058&r1=726057&r2=726058&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/model/Branding.java
(original)
+++ geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/model/Branding.java
Fri Dec 12 07:52:05 2008
@@ -63,6 +63,8 @@
 
     private String goodbyeMessage;
 
+    private String prompt;
+
     public String toString() {
         return Yarn.render(this);
     }
@@ -221,6 +223,14 @@
         this.goodbyeMessage = goodbyeMessage;
     }
 
+    public String getPrompt() {
+        return prompt;
+    }
+
+    public void setPrompt(final String prompt) {
+        this.prompt = prompt;
+    }
+
     public Properties getProperties() {
         if (properties == null) {
             properties = new Properties();

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/branding/GShellBranding.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/branding/GShellBranding.java?rev=726058&r1=726057&r2=726058&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/branding/GShellBranding.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/branding/GShellBranding.java
Fri Dec 12 07:52:05 2008
@@ -149,4 +149,9 @@
     public void setWelcomeMessage(String welcomeMessage) {
         throw new UnsupportedOperationException();
     }
+
+    @Override
+    public String getPrompt() {
+        return "@|bold %{application.userName}|@%{application.localHost.hostName}:@|bold
%{branding.name}:%{gshell.group}|> ";
+    }
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandSupport.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandSupport.java?rev=726058&r1=726057&r2=726058&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandSupport.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandSupport.java
Fri Dec 12 07:52:05 2008
@@ -304,7 +304,6 @@
 
             log.trace("Result: {}", value);
 
-            // Save the result to the shell's context under "gshell.result"
             context.getVariables().set("gshell.result", value);
 
             result = new CommandResult.ValueResult(value);

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java?rev=726058&r1=726057&r2=726058&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java
Fri Dec 12 07:52:05 2008
@@ -131,9 +131,8 @@
         // HACK: Add history for the 'history' command, since its not part of the Shell interf
it can't really access it easy, resolve with ^^^
         vars.set("SHELL.HISTORY", getHistory(), true);
 
-        // HACK: Set the default prompt here for now, probably want to get this from branding
-        vars.set("gshell.prompt", "@|bold %{application.userName}|@%{application.localHost.hostName}:@|bold
%{branding.name}:%{gshell.group}|> ");
-        
+        vars.set("gshell.prompt", application.getModel().getBranding().getPrompt());
+
         vars.set(CommandResolver.GROUP, "/");
 
         branding = application.getModel().getBranding();



Mime
View raw message