servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r649194 - in /servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main: java/org/apache/geronimo/gshell/spring/Prompter.java resources/META-INF/spring/gshell.xml
Date Thu, 17 Apr 2008 17:23:49 GMT
Author: chirino
Date: Thu Apr 17 10:23:42 2008
New Revision: 649194

URL: http://svn.apache.org/viewvc?rev=649194&view=rev
Log:
Simplifying the prompt a little

Modified:
    servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/Prompter.java
    servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/META-INF/spring/gshell.xml

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/Prompter.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/Prompter.java?rev=649194&r1=649193&r2=649194&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/Prompter.java
(original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/Prompter.java
Thu Apr 17 10:23:42 2008
@@ -17,6 +17,7 @@
 package org.apache.geronimo.gshell.spring;
 
 import org.apache.geronimo.gshell.ansi.Renderer;
+import org.apache.geronimo.gshell.branding.Branding;
 import org.apache.geronimo.gshell.console.Console;
 import org.apache.geronimo.gshell.layout.LayoutManager;
 import org.apache.geronimo.gshell.layout.model.Node;
@@ -31,22 +32,35 @@
     private Renderer renderer = new Renderer();
     private ShellInfo shellInfo;
     private Environment env;
+    private Branding branding;
 
     public Prompter(ShellInfo shellInfo, Environment env) {
-        this.shellInfo = shellInfo;
-        this.env = env;
+    	this.shellInfo = shellInfo;
+    	this.env = env;
     }
 
+    public Branding getBranding() {
+		return branding;
+	}
+
+	public void setBranding(Branding branding) {
+		this.branding = branding;
+	}
+
+
     public String prompt() {
         String userName = shellInfo.getUserName();
         String hostName = shellInfo.getLocalHost().getHostName();
 
         Node start = (Node) env.getVariables().get(LayoutManager.CURRENT_NODE);
-        String path = "/";
+        String path = "";
         if (start != null) {
             path = start.getPath();
+            path = path.replace('/', ' ');
         }
 
-        return renderer.render("@|bold " + userName + "|@" + hostName + ":@|bold " + path
+ "|> ");
+        // return renderer.render("@|bold " + userName + "|@" + hostName + ":@|bold " + path
+ "|> ");
+        // I think a simpler prompt would be best.
+        return renderer.render("@|bold "+branding.getName()+path+"|> ");
     }
 }

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/META-INF/spring/gshell.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/META-INF/spring/gshell.xml?rev=649194&r1=649193&r2=649194&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/META-INF/spring/gshell.xml
(original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/META-INF/spring/gshell.xml
Thu Apr 17 10:23:42 2008
@@ -83,6 +83,7 @@
     <bean id="prompter" class="org.apache.geronimo.gshell.spring.Prompter">
         <constructor-arg ref="shellInfo" />
         <constructor-arg ref="environment" />
+        <property name="branding" ref="branding" />
     </bean>
 
 </beans>



Mime
View raw message