geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r698855 - in /geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main: java/org/apache/geronimo/gshell/commands/builtins/ resources/org/apache/geronimo/gshell/commands/builtins/
Date Thu, 25 Sep 2008 08:13:58 GMT
Author: jdillon
Date: Thu Sep 25 01:13:58 2008
New Revision: 698855

URL: http://svn.apache.org/viewvc?rev=698855&view=rev
Log:
Externalize token for i18n

Modified:
    geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/ExitAction.java
    geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpAction.java
    geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/ExitAction.properties
    geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/HelpAction.properties

Modified: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/ExitAction.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/ExitAction.java?rev=698855&r1=698854&r2=698855&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/ExitAction.java
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/ExitAction.java
Thu Sep 25 01:13:58 2008
@@ -36,7 +36,7 @@
 {
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    @Argument(token="CODE")
+    @Argument
     private int exitCode = 0;
 
     public Object execute(final CommandContext context) throws Exception {

Modified: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpAction.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpAction.java?rev=698855&r1=698854&r2=698855&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpAction.java
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpAction.java
Thu Sep 25 01:13:58 2008
@@ -22,17 +22,17 @@
 import org.apache.geronimo.gshell.ansi.Code;
 import org.apache.geronimo.gshell.ansi.Renderer;
 import org.apache.geronimo.gshell.clp.Argument;
+import org.apache.geronimo.gshell.command.Command;
 import org.apache.geronimo.gshell.command.CommandAction;
 import org.apache.geronimo.gshell.command.CommandContext;
-import org.apache.geronimo.gshell.command.CommandRegistry;
-import org.apache.geronimo.gshell.command.CommandRegistration;
-import org.apache.geronimo.gshell.command.Command;
 import org.apache.geronimo.gshell.command.CommandDocumenter;
+import org.apache.geronimo.gshell.command.CommandRegistration;
+import org.apache.geronimo.gshell.command.CommandRegistry;
 import org.apache.geronimo.gshell.io.IO;
+import org.codehaus.plexus.util.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.codehaus.plexus.util.StringUtils;
 
 import java.util.List;
 
@@ -49,11 +49,9 @@
     @Autowired
     private CommandRegistry commandRegistry;
 
-    @Argument(token="COMMAND")
+    @Argument
     private String commandName;
 
-    private Renderer renderer = new Renderer();
-
     public Object execute(final CommandContext context) throws Exception {
         assert context != null;
         IO io = context.getIo();
@@ -77,9 +75,16 @@
                 }
             }
 
-            io.out.println("Command " + Renderer.encode(commandName, Code.BOLD) + " not found.");
-            io.out.println("Try " + Renderer.encode("help", Code.BOLD) + " for a list of
available commands.");
-            
+            io.out.print("Command ");
+            io.out.print(Renderer.encode(commandName, Code.BOLD));
+            io.out.println(" not found.");
+
+            io.out.print("Try ");
+            io.out.print(Renderer.encode("help", Code.BOLD));
+            io.out.println(" for a list of available commands.");
+
+            io.out.println();
+
             return Result.FAILURE;
         }
         else {
@@ -98,7 +103,7 @@
                 String desc = doc.getDescription();
 
                 io.out.print("  ");
-                io.out.print(renderer.render(Renderer.encode(name, Code.BOLD)));
+                io.out.print(Renderer.encode(name, Code.BOLD));
 
                 if (desc != null) {
                     io.out.print("  ");

Modified: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/ExitAction.properties
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/ExitAction.properties?rev=698855&r1=698854&r2=698855&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/ExitAction.properties
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/ExitAction.properties
Thu Sep 25 01:13:58 2008
@@ -26,6 +26,7 @@
 command.description=Exit the current shell.
 
 command.argument.exitCode=System exit code
+command.argument.exitCode.token=CODE
 
 command.manual=\
   TODO: exit manual
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/HelpAction.properties
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/HelpAction.properties?rev=698855&r1=698854&r2=698855&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/HelpAction.properties
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/org/apache/geronimo/gshell/commands/builtins/HelpAction.properties
Thu Sep 25 01:13:58 2008
@@ -26,6 +26,7 @@
 command.description=Display help for the current context.
 
 command.argument.commandName=Display the manual for COMMAND
+command.argument.commandName.token=COMMAND
 
 command.manual=\
   TODO: help manual
\ No newline at end of file



Mime
View raw message