You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2008/06/20 20:17:03 UTC

svn commit: r670015 - in /geronimo/gshell/trunk: gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandDocumenter.java

Author: jdillon
Date: Fri Jun 20 11:17:03 2008
New Revision: 670015

URL: http://svn.apache.org/viewvc?rev=670015&view=rev
Log:
Add more muck to support command manuals

Modified:
    geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java
    geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandDocumenter.java

Modified: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java?rev=670015&r1=670014&r2=670015&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java (original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java Fri Jun 20 11:17:03 2008
@@ -28,6 +28,10 @@
 import org.apache.geronimo.gshell.command.CommandContainerFactory;
 import org.apache.geronimo.gshell.command.CommandContext;
 import org.apache.geronimo.gshell.command.CommandResolver;
+import org.apache.geronimo.gshell.command.Command;
+import org.apache.geronimo.gshell.command.CommandException;
+import org.apache.geronimo.gshell.command.CommandDocumenter;
+import org.apache.geronimo.gshell.command.CommandInfo;
 import org.apache.geronimo.gshell.command.annotation.CommandComponent;
 import org.apache.geronimo.gshell.command.annotation.Requirement;
 import org.apache.geronimo.gshell.io.IO;
@@ -181,10 +185,20 @@
         }
     }
 
-    private void displayCommandManual(final String command, final ShellContext context) {
+    private void displayCommandManual(final String command, final ShellContext context) throws CommandException {
         assert command != null;
         assert context != null;
 
-        // CommandContainer command = commandResolver.resolve(context, command);
+        IO io = context.getIo();
+
+        Command cmd = commandResolver.resolve(context, command);
+
+        CommandDocumenter documenter = cmd.getDocumenter();
+        CommandInfo info = cmd.getInfo();
+
+        log.debug("Rendering help for command: {}", info.getName());
+
+        documenter.renderManual(info, io.out);
+
     }
 }

Modified: geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandDocumenter.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandDocumenter.java?rev=670015&r1=670014&r2=670015&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandDocumenter.java (original)
+++ geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandDocumenter.java Fri Jun 20 11:17:03 2008
@@ -142,6 +142,8 @@
         assert info != null;
         assert out != null;
 
-        // TODO: Render a more complete manual for the command, maybe using simple APT-like syntax.
+        out.println(info.getName());
+        out.println();
+        out.println("TODO: Full docs");
     }
 }
\ No newline at end of file