geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r697338 - /geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandDocumenterImpl.java
Date Sat, 20 Sep 2008 09:25:43 GMT
Author: jdillon
Date: Sat Sep 20 02:25:42 2008
New Revision: 697338

URL: http://svn.apache.org/viewvc?rev=697338&view=rev
Log:
Make the command manual display more 'man'-like

Modified:
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandDocumenterImpl.java

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandDocumenterImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandDocumenterImpl.java?rev=697338&r1=697337&r2=697338&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandDocumenterImpl.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandDocumenterImpl.java
Sat Sep 20 02:25:42 2008
@@ -26,6 +26,8 @@
 import org.apache.geronimo.gshell.command.CommandAware;
 import org.apache.geronimo.gshell.command.CommandDocumenter;
 import org.apache.geronimo.gshell.i18n.PrefixingMessageSource;
+import org.apache.geronimo.gshell.ansi.Renderer;
+import org.apache.geronimo.gshell.ansi.Code;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -49,6 +51,8 @@
 
     private String manual;
 
+    private Renderer renderer = new Renderer();
+
     public String getName() {
         if (name == null) {
             name = getCommand().getMessages().getMessage("command.name");
@@ -131,12 +135,18 @@
 
         log.debug("Rendering command manual");
 
+        out.println(renderer.render(Renderer.encode("NAME", Code.BOLD)));
+        out.print("  ");
         out.println(getName());
         out.println();
 
-        String manual = getManual();
+        out.println(renderer.render(Renderer.encode("DESCRIPTION", Code.BOLD)));
+        out.print("  ");
+        out.println(getDescription());
+        out.println();
 
-        out.println(manual);
+        out.println(renderer.render(Renderer.encode("MANUAL", Code.BOLD)));
+        out.println(getManual());
         out.println();
     }
 }
\ No newline at end of file



Mime
View raw message