geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r698110 - in /geronimo/gshell/trunk: gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/ gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/ gshell-commands/gshell-builtins/src/main/java/org/apache/ger...
Date Tue, 23 Sep 2008 07:39:23 GMT
Author: jdillon
Date: Tue Sep 23 00:39:22 2008
New Revision: 698110

URL: http://svn.apache.org/viewvc?rev=698110&view=rev
Log:
Changed CLP "metaVar" to "token" (this one has been bothering me for a while)
Added i18n for CLP's Printer when generating usage syntax

Added:
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/Printer.properties
  (contents, props changed)
      - copied, changed from r697852, geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/Messages.properties
Modified:
    geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
    geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/InstallPluginAction.java
    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-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/JavaAction.java
    geronimo/gshell/trunk/gshell-commands/gshell-repository/src/main/java/org/apache/geronimo/gshell/commands/repository/ResolveAction.java
    geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshCommand.java
    geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServerCommand.java
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Argument.java
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/ArgumentDescriptor.java
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Descriptor.java
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Option.java
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/OptionDescriptor.java
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Printer.java
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/BooleanHandler.java
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/DoubleHandler.java
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/EnumHandler.java
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/FileHandler.java
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/Handler.java
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/IntegerHandler.java
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/LongHandler.java
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/ObjectHandler.java
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/StopHandler.java
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/StringHandler.java
    geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/UriHandler.java

Modified: geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java?rev=698110&r1=698109&r2=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
(original)
+++ geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
Tue Sep 23 00:39:22 2008
@@ -113,13 +113,13 @@
         }
     }
 
-    @Option(name="-c", aliases={"--commands"}, metaVar="STRING")
+    @Option(name="-c", aliases={"--commands"}, token ="STRING")
     private String commands;
 
-    @Argument(metaVar="COMMAND")
+    @Argument(token ="COMMAND")
     private List<String> commandArgs = null;
 
-    @Option(name="-D", aliases={"--define"}, metaVar="NAME=VALUE")
+    @Option(name="-D", aliases={"--define"}, token ="NAME=VALUE")
     private void setSystemProperty(final String nameValue) {
         assert nameValue != null;
 
@@ -144,7 +144,7 @@
         ANSI.setEnabled(flag);
     }
 
-    @Option(name="-T", aliases={"--terminal"}, metaVar="TYPE", argumentRequired=true)
+    @Option(name="-T", aliases={"--terminal"}, token ="TYPE", argumentRequired=true)
     private void setTerminalType(String type) {
         type = type.toLowerCase();
 

Modified: geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/InstallPluginAction.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/InstallPluginAction.java?rev=698110&r1=698109&r2=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/InstallPluginAction.java
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-admin/src/main/java/org/apache/geronimo/gshell/commands/admin/InstallPluginAction.java
Tue Sep 23 00:39:22 2008
@@ -42,13 +42,13 @@
     @Autowired
     private PluginManager pluginManager;
 
-    @Option(name="-g", aliases={"--groupId"}, argumentRequired=true, metaVar="GROUP-ID",
required=true)
+    @Option(name="-g", aliases={"--groupId"}, argumentRequired=true, token ="GROUP-ID", required=true)
     private String groupId;
 
-    @Option(name="-a", aliases={"--artifactId"}, argumentRequired=true, metaVar="ARTIFACT-ID",
required=true)
+    @Option(name="-a", aliases={"--artifactId"}, argumentRequired=true, token ="ARTIFACT-ID",
required=true)
     private String artifactId;
 
-    @Option(name="-v", aliases={"--version"}, argumentRequired=true, metaVar="VERSION", required=true)
+    @Option(name="-v", aliases={"--version"}, argumentRequired=true, token ="VERSION", required=true)
     private String version;
     
     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/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=698110&r1=698109&r2=698110&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
Tue Sep 23 00:39:22 2008
@@ -36,7 +36,7 @@
 {
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    @Argument(metaVar="CODE")
+    @Argument(token ="CODE")
     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=698110&r1=698109&r2=698110&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
Tue Sep 23 00:39:22 2008
@@ -49,7 +49,7 @@
     @Autowired
     private CommandRegistry commandRegistry;
 
-    @Argument(metaVar="COMMAND")
+    @Argument(token ="COMMAND")
     private String commandName;
 
     private Renderer renderer = new Renderer();

Modified: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/JavaAction.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/JavaAction.java?rev=698110&r1=698109&r2=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/JavaAction.java
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/JavaAction.java
Tue Sep 23 00:39:22 2008
@@ -44,13 +44,13 @@
 {
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    @Option(name="-m", aliases={"--method"}, metaVar="METHOD")
+    @Option(name="-m", aliases={"--method"}, token ="METHOD")
     private String methodName = "main";
 
-    @Argument(index=0, metaVar="CLASSNAME", required=true)
+    @Argument(index=0, token ="CLASSNAME", required=true)
     private String className;
 
-    @Argument(index=1, metaVar="ARG")
+    @Argument(index=1, token ="ARG")
     private List<String> args;
 
     public Object execute(final CommandContext context) throws Exception {

Modified: geronimo/gshell/trunk/gshell-commands/gshell-repository/src/main/java/org/apache/geronimo/gshell/commands/repository/ResolveAction.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-repository/src/main/java/org/apache/geronimo/gshell/commands/repository/ResolveAction.java?rev=698110&r1=698109&r2=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-repository/src/main/java/org/apache/geronimo/gshell/commands/repository/ResolveAction.java
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-repository/src/main/java/org/apache/geronimo/gshell/commands/repository/ResolveAction.java
Tue Sep 23 00:39:22 2008
@@ -53,23 +53,23 @@
     // TODO: Consider using <g>:<a>:<v>:<s>:<t> notation instead
of, or in addtion this?
     //
     
-    @Option(name="-g", aliases={"--groupId"}, argumentRequired=true, metaVar="GROUP-ID",
required=true)
+    @Option(name="-g", aliases={"--groupId"}, argumentRequired=true, token ="GROUP-ID", required=true)
     private String groupId;
 
-    @Option(name="-a", aliases={"--artifactId"}, argumentRequired=true, metaVar="ARTIFACT-ID",
required=true)
+    @Option(name="-a", aliases={"--artifactId"}, argumentRequired=true, token ="ARTIFACT-ID",
required=true)
     private String artifactId;
 
-    @Option(name="-v", aliases={"--version"}, argumentRequired=true, metaVar="VERSION", required=true)
+    @Option(name="-v", aliases={"--version"}, argumentRequired=true, token ="VERSION", required=true)
     private String version;
 
-    @Option(name="-t", aliases={"--type"}, argumentRequired=true, metaVar="TYPE")
+    @Option(name="-t", aliases={"--type"}, argumentRequired=true, token ="TYPE")
     private String type = "jar";
 
     //
     // TODO: Add classifier
     //
 
-    @Option(name="-s", aliases={"--scope"}, argumentRequired=true, metaVar="SCOPE")
+    @Option(name="-s", aliases={"--scope"}, argumentRequired=true, token ="SCOPE")
     private String scope;
 
     @Option(name="-T", aliases={"--transitive"})

Modified: geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshCommand.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshCommand.java?rev=698110&r1=698109&r2=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshCommand.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshCommand.java
Tue Sep 23 00:39:22 2008
@@ -46,19 +46,19 @@
 {
     private final Logger log = LoggerFactory.getLogger(getClass());
     
-    @Option(name="-b", aliases={"--bind"}, metaVar="URI")
+    @Option(name="-b", aliases={"--bind"}, token ="URI")
     private URI local;
 
-    @Option(name="-u", aliases={"--username"}, metaVar="USERNAME")
+    @Option(name="-u", aliases={"--username"}, token ="USERNAME")
     private String username;
 
-    @Option(name="-p", aliases={"--password"}, metaVar="PASSWORD")
+    @Option(name="-p", aliases={"--password"}, token ="PASSWORD")
     private String password;
     
-    @Argument(metaVar="URI", required=true, index=0)
+    @Argument(token ="URI", required=true, index=0)
     private URI remote;
 
-    @Argument(metaVar="COMMAND", index=1, multiValued=true)
+    @Argument(token ="COMMAND", index=1, multiValued=true)
     private List<String> command = new ArrayList<String>();
 
     private BeanContainer container;

Modified: geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServerCommand.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServerCommand.java?rev=698110&r1=698109&r2=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServerCommand.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServerCommand.java
Tue Sep 23 00:39:22 2008
@@ -44,7 +44,7 @@
     @Option(name="-b", aliases={ "--background"})
     private boolean background;
 
-    @Argument(metaVar="URI", required=true)
+    @Argument(token ="URI", required=true)
     private URI location;
 
     private BeanContainer container;

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Argument.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Argument.java?rev=698110&r1=698109&r2=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Argument.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Argument.java
Tue Sep 23 00:39:22 2008
@@ -37,7 +37,7 @@
 {
     String description() default "";
 
-    String metaVar() default "";
+    String token() default "";
 
     boolean required() default false;
 

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/ArgumentDescriptor.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/ArgumentDescriptor.java?rev=698110&r1=698109&r2=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/ArgumentDescriptor.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/ArgumentDescriptor.java
Tue Sep 23 00:39:22 2008
@@ -28,12 +28,12 @@
     extends Descriptor
 {
     public ArgumentDescriptor(final String id, final Argument argument, final boolean forceMultiValued)
{
-        super(id, argument.description(), argument.metaVar(), argument.required(), argument.handler(),
argument.multiValued() || forceMultiValued);
+        super(id, argument.description(), argument.token(), argument.required(), argument.handler(),
argument.multiValued() || forceMultiValued);
     }
 
     @Override
     public String toString() {
-        String tmp = getMetaVar();
+        String tmp = getToken();
         if (tmp != null && tmp.length() != 0) {
             return tmp;
         }

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Descriptor.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Descriptor.java?rev=698110&r1=698109&r2=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Descriptor.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Descriptor.java
Tue Sep 23 00:39:22 2008
@@ -32,7 +32,7 @@
 
     private final String description;
 
-    private final String metaVar;
+    private final String token;
 
     private final boolean required;
 
@@ -40,7 +40,7 @@
 
     private final Class<? extends Handler> handler;
 
-    protected Descriptor(final String id, final String description, final String metaVar,
final boolean required, final Class<? extends Handler> handler, final boolean multiValued)
{
+    protected Descriptor(final String id, final String description, final String token, final
boolean required, final Class<? extends Handler> handler, final boolean multiValued)
{
         assert id != null;
 
         this.id = id;
@@ -53,11 +53,11 @@
             this.description = description;
         }
 
-        if (metaVar != null && metaVar.length() == 0) {
-            this.metaVar = null;
+        if (token != null && token.length() == 0) {
+            this.token = null;
         }
         else {
-            this.metaVar = metaVar;
+            this.token = token;
         }
         
         this.required = required;
@@ -73,8 +73,8 @@
         return description;
     }
 
-    public String getMetaVar() {
-        return metaVar;
+    public String getToken() {
+        return token;
     }
 
     public boolean isRequired() {

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Option.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Option.java?rev=698110&r1=698109&r2=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Option.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Option.java
Tue Sep 23 00:39:22 2008
@@ -41,7 +41,7 @@
 
     String description() default "";
 
-    String metaVar() default "";
+    String token() default "";
 
     boolean required() default false;
 

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/OptionDescriptor.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/OptionDescriptor.java?rev=698110&r1=698109&r2=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/OptionDescriptor.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/OptionDescriptor.java
Tue Sep 23 00:39:22 2008
@@ -36,7 +36,7 @@
     private final boolean requireOverride;
 
     public OptionDescriptor(final String id, final Option option, final boolean forceMultiValued)
{
-        super(id, option.description(), option.metaVar(), option.required(), option.handler(),
option.multiValued() || forceMultiValued);
+        super(id, option.description(), option.token(), option.required(), option.handler(),
option.multiValued() || forceMultiValued);
     	
     	this.name = option.name();
     	this.aliases = option.aliases();

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Printer.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Printer.java?rev=698110&r1=698109&r2=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Printer.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/Printer.java
Tue Sep 23 00:39:22 2008
@@ -29,6 +29,7 @@
 import org.apache.geronimo.gshell.clp.handler.Handler;
 import org.apache.geronimo.gshell.i18n.MessageSource;
 import org.apache.geronimo.gshell.i18n.ResourceNotFoundException;
+import org.apache.geronimo.gshell.i18n.ResourceBundleMessageSource;
 
 /**
  * Helper to print formatted help and usage text.
@@ -39,6 +40,12 @@
 {
     private CommandLineProcessor processor;
 
+    //
+    // TODO: Combine these into 1 dynamic MS
+    //
+
+    private MessageSource printerMessages = new ResourceBundleMessageSource(Printer.class);
+
     private MessageSource messages;
 
     public Printer(final CommandLineProcessor processor) {
@@ -87,12 +94,12 @@
         return message;
     }
 
-    private String getMetaVariable(final Handler handler) {
+    private String getToken(final Handler handler) {
         assert handler != null;
 
-        String token = handler.descriptor.getMetaVar();
+        String token = handler.descriptor.getToken();
         if (token == null) {
-            token = handler.getDefaultMetaVariable();
+            token = handler.getDefaultToken();
         }
 
         if (token == null) {
@@ -102,17 +109,17 @@
         return token;
     }
 
-    private String getNameAndMeta(final Handler handler) {
+    private String getNameAndToken(final Handler handler) {
         assert handler != null;
 
         String str = (handler.descriptor instanceof ArgumentDescriptor) ? "" : handler.descriptor.toString();
-    	String meta = getMetaVariable(handler);
+    	String token = getToken(handler);
 
-        if (meta != null) {
+        if (token != null) {
             if (str.length() > 0) {
                 str += " ";
             }
-            str += meta;
+            str += token;
     	}
         
         return str;
@@ -126,7 +133,7 @@
             return 0;
         }
 
-        return getNameAndMeta(handler).length();
+        return getNameAndToken(handler).length();
     }
 
     public void printUsage(final Writer writer, final String name) {
@@ -147,17 +154,13 @@
             }
         });
 
-        //
-        // TODO: i18n, pull for standard messages, not from command's messages
-        //
-        
         if (name != null) {
-        	String syntax = "syntax: " + name;
-        	if (!optionHandlers.isEmpty()) {
-        		syntax += " [options]";
+        	String syntax = printerMessages.format("syntax", name);
+            if (!optionHandlers.isEmpty()) {
+                syntax = printerMessages.format("syntax.hasOptions", syntax);
         	}
         	if (!argumentHandlers.isEmpty()) {
-        		syntax += " [arguments]";
+                syntax = printerMessages.format("syntax.hasArguments", syntax);
         	}
         	out.println(syntax);
         	out.println();
@@ -178,7 +181,7 @@
 
         // And then render the handler usage
         if (!argumentHandlers.isEmpty()) {
-        	out.println("arguments:");
+        	out.println(printerMessages.getMessage("arguments.header"));
 
             for (Handler handler : argumentHandlers) {
                 printHandler(out, handler, len);
@@ -188,7 +191,7 @@
         }
 
         if (!optionHandlers.isEmpty()) {
-        	out.println("options:");
+            out.println(printerMessages.getMessage("options.header"));
             
             for (Handler handler : optionHandlers) {
                 printHandler(out, handler, len);
@@ -225,12 +228,12 @@
         }
 
         // Render the prefix and syntax
-        String nameAndMeta = getNameAndMeta(handler);
+        String nameAndToken = getNameAndToken(handler);
         out.print(prefix);
-        out.print(nameAndMeta);
+        out.print(nameAndToken);
 
         // Render the seperator
-        for (int i = nameAndMeta.length(); i < len; ++i) {
+        for (int i = nameAndToken.length(); i < len; ++i) {
             out.print(' ');
        	}
         out.print(separator);

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/BooleanHandler.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/BooleanHandler.java?rev=698110&r1=698109&r2=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/BooleanHandler.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/BooleanHandler.java
Tue Sep 23 00:39:22 2008
@@ -73,7 +73,7 @@
     }
 
     @Override
-    public String getDefaultMetaVariable() {
+    public String getDefaultToken() {
         return null;
     }
 }

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/DoubleHandler.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/DoubleHandler.java?rev=698110&r1=698109&r2=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/DoubleHandler.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/DoubleHandler.java
Tue Sep 23 00:39:22 2008
@@ -47,7 +47,7 @@
     }
 
     @Override
-    public String getDefaultMetaVariable() {
+    public String getDefaultToken() {
         return "N";
     }
 }

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/EnumHandler.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/EnumHandler.java?rev=698110&r1=698109&r2=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/EnumHandler.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/EnumHandler.java
Tue Sep 23 00:39:22 2008
@@ -65,7 +65,7 @@
     }
 
     @Override
-    public String getDefaultMetaVariable() {
+    public String getDefaultToken() {
     	StringBuffer buff = new StringBuffer();
     	buff.append("[");
 

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/FileHandler.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/FileHandler.java?rev=698110&r1=698109&r2=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/FileHandler.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/FileHandler.java
Tue Sep 23 00:39:22 2008
@@ -48,7 +48,7 @@
     }
 
     @Override
-    public String getDefaultMetaVariable() {
+    public String getDefaultToken() {
         return "FILE";
     }
 }

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/Handler.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/Handler.java?rev=698110&r1=698109&r2=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/Handler.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/Handler.java
Tue Sep 23 00:39:22 2008
@@ -46,5 +46,5 @@
 
     public abstract int handle(Parameters params) throws ProcessingException;
 
-    public abstract String getDefaultMetaVariable();
+    public abstract String getDefaultToken();
 }

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/IntegerHandler.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/IntegerHandler.java?rev=698110&r1=698109&r2=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/IntegerHandler.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/IntegerHandler.java
Tue Sep 23 00:39:22 2008
@@ -47,7 +47,7 @@
     }
 
     @Override
-    public String getDefaultMetaVariable() {
+    public String getDefaultToken() {
         return "N";
     }
 }

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/LongHandler.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/LongHandler.java?rev=698110&r1=698109&r2=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/LongHandler.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/LongHandler.java
Tue Sep 23 00:39:22 2008
@@ -47,7 +47,7 @@
     }
 
     @Override
-    public String getDefaultMetaVariable() {
+    public String getDefaultToken() {
         return "N";
     }
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/ObjectHandler.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/ObjectHandler.java?rev=698110&r1=698109&r2=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/ObjectHandler.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/ObjectHandler.java
Tue Sep 23 00:39:22 2008
@@ -49,7 +49,7 @@
     }
 
     @Override
-    public String getDefaultMetaVariable() {
+    public String getDefaultToken() {
         return "VAL";
     }
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/StopHandler.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/StopHandler.java?rev=698110&r1=698109&r2=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/StopHandler.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/StopHandler.java
Tue Sep 23 00:39:22 2008
@@ -42,7 +42,7 @@
     }
 
     @Override
-    public String getDefaultMetaVariable() {
+    public String getDefaultToken() {
         return "ARGUMENTS";
     }
 }

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/StringHandler.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/StringHandler.java?rev=698110&r1=698109&r2=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/StringHandler.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/StringHandler.java
Tue Sep 23 00:39:22 2008
@@ -46,7 +46,7 @@
     }
 
     @Override
-    public String getDefaultMetaVariable() {
+    public String getDefaultToken() {
         return "VAL";
     }
 }

Modified: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/UriHandler.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/UriHandler.java?rev=698110&r1=698109&r2=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/UriHandler.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/java/org/apache/geronimo/gshell/clp/handler/UriHandler.java
Tue Sep 23 00:39:22 2008
@@ -55,7 +55,7 @@
     }
 
     @Override
-    public String getDefaultMetaVariable() {
+    public String getDefaultToken() {
         return "URI";
     }
 }
\ No newline at end of file

Copied: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/Printer.properties
(from r697852, geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/Messages.properties)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/Printer.properties?p2=geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/Printer.properties&p1=geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/Messages.properties&r1=697852&r2=698110&rev=698110&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/Messages.properties
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/Printer.properties
Tue Sep 23 00:39:22 2008
@@ -21,14 +21,8 @@
 ## $Rev$ $Date$
 ##
 
-MISSING_OPERAND=Option "{0}" takes an operand
-
-UNDEFINED_OPTION="{0}" is not a valid option
-
-NO_ARGUMENT_ALLOWED=No argument is allowed: {0}
-
-REQUIRED_OPTION_MISSING=Option "{0}" is required
-
-REQUIRED_ARGUMENT_MISSING=Argument "{0}" is required
-
-TOO_MANY_ARGUMENTS=Too many arguments: {0}
+syntax=syntax: {0}
+syntax.hasOptions={0} [options]
+syntax.hasArguments={0} [arguments]
+arguments.header=arguments:
+options.header=options:
\ No newline at end of file

Propchange: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/Printer.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/Printer.properties
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/Printer.properties
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: geronimo/gshell/trunk/gshell-support/gshell-clp/src/main/resources/org/apache/geronimo/gshell/clp/Printer.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message