geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r411705 - in /geronimo/sandbox/gshell/trunk: ./ gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/ gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/
Date Mon, 05 Jun 2006 08:02:56 GMT
Author: jdillon
Date: Mon Jun  5 01:02:55 2006
New Revision: 411705

URL: http://svn.apache.org/viewvc?rev=411705&view=rev
Log:
Use message source

Added:
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/ExitCommandMessages.properties
  (with props)
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/HelpCommandMessages.properties
  (with props)
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/UnsetCommandMessages.properties
  (with props)
Modified:
    geronimo/sandbox/gshell/trunk/NOTES.txt
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/ExitCommand.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/HelpCommand.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/UnsetCommand.java

Modified: geronimo/sandbox/gshell/trunk/NOTES.txt
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/NOTES.txt?rev=411705&r1=411704&r2=411705&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/NOTES.txt (original)
+++ geronimo/sandbox/gshell/trunk/NOTES.txt Mon Jun  5 01:02:55 2006
@@ -7,9 +7,7 @@
 
  ----
 
-Variable support, expressions... should the parser do this?
-    Parse out ${...}, then use Jexl or something to eval?
-    Should "xxx ${...} yyy" also be handled by parser... or sub parse by string node when
visited?
+Add ${...} parsing to the CommandLineParser; remove VariableExpressionParser
 
 Switch to Object execute(String name, Object...)
 
@@ -48,8 +46,6 @@
  * * *
 
 Maybe just use the JLine API directly instead of trying to abstract it?
-
-Command line completion ala JLine
 
 Refactor output and verbosity filters...
 

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/ExitCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/ExitCommand.java?rev=411705&r1=411704&r2=411705&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/ExitCommand.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/ExitCommand.java
Mon Jun  5 01:02:55 2006
@@ -24,6 +24,7 @@
 import org.apache.commons.cli.PosixParser;
 import org.apache.geronimo.gshell.command.Command;
 import org.apache.geronimo.gshell.command.CommandSupport;
+import org.apache.geronimo.gshell.command.MessageSource;
 import org.apache.geronimo.gshell.console.IO;
 import org.apache.geronimo.gshell.ExitNotification;
 import org.apache.geronimo.gshell.util.Arguments;
@@ -43,6 +44,8 @@
     protected int doExecute(String[] args) throws Exception {
         assert args != null;
 
+        MessageSource messages = getMessageSource();
+
         //
         // TODO: Optimize, move common code to CommandSupport
         //
@@ -52,7 +55,7 @@
         Options options = new Options();
 
         options.addOption(OptionBuilder.withLongOpt("help")
-            .withDescription("Display this help message")
+            .withDescription(messages.getMessage("cli.option.help"))
             .create('h'));
 
         CommandLineParser parser = new PosixParser();
@@ -72,9 +75,10 @@
         }
 
         if (usage || line.hasOption('h')) {
-            io.out.println(getName() + " -- exit the current shell");
+            io.out.print(" -- ");
+            io.out.println(messages.getMessage("cli.usage.description"));
             io.out.println();
-
+            
             HelpFormatter formatter = new HelpFormatter();
             formatter.printHelp(
                 io.out,

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/HelpCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/HelpCommand.java?rev=411705&r1=411704&r2=411705&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/HelpCommand.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/HelpCommand.java
Mon Jun  5 01:02:55 2006
@@ -27,6 +27,7 @@
 import org.apache.geronimo.gshell.command.CommandSupport;
 import org.apache.geronimo.gshell.command.CommandManager;
 import org.apache.geronimo.gshell.command.CommandDefinition;
+import org.apache.geronimo.gshell.command.MessageSource;
 import org.apache.geronimo.gshell.console.IO;
 import org.apache.geronimo.gshell.util.Arguments;
 
@@ -68,6 +69,8 @@
     protected int doExecute(final String[] args) throws Exception {
         assert args != null;
 
+        MessageSource messages = getMessageSource();
+
         //
         // TODO: Optimize, move common code to CommandSupport
         //
@@ -77,7 +80,7 @@
         Options options = new Options();
 
         options.addOption(OptionBuilder.withLongOpt("help")
-            .withDescription("Display this help message")
+            .withDescription(messages.getMessage("cli.option.help"))
             .create('h'));
 
         CommandLineParser parser = new PosixParser();
@@ -99,7 +102,8 @@
         }
 
         if (usage || line.hasOption('h')) {
-            io.out.println(getName() + " -- display help");
+            io.out.print(" -- ");
+            io.out.println(messages.getMessage("cli.usage.description"));
             io.out.println();
 
             HelpFormatter formatter = new HelpFormatter();
@@ -115,9 +119,9 @@
                 false); // auto usage
 
             io.out.println();
-            io.out.println("For a list of topics try: help topics");
+            io.out.println(messages.getMessage("cli.usage.footer"));
             io.out.println();
-
+            
             return Command.SUCCESS;
         }
 

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/UnsetCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/UnsetCommand.java?rev=411705&r1=411704&r2=411705&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/UnsetCommand.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/UnsetCommand.java
Mon Jun  5 01:02:55 2006
@@ -26,6 +26,7 @@
 import org.apache.geronimo.gshell.command.CommandSupport;
 import org.apache.geronimo.gshell.command.Variables;
 import org.apache.geronimo.gshell.command.VariablesImpl;
+import org.apache.geronimo.gshell.command.MessageSource;
 import org.apache.geronimo.gshell.console.IO;
 
 /**
@@ -49,6 +50,8 @@
     protected int doExecute(String[] args) throws Exception {
         assert args != null;
 
+        MessageSource messages = getMessageSource();
+
         //
         // TODO: Optimize, move common code to CommandSupport
         //
@@ -58,11 +61,11 @@
         Options options = new Options();
 
         options.addOption(OptionBuilder.withLongOpt("help")
-            .withDescription("Display this help message")
+            .withDescription(messages.getMessage("cli.option.help"))
             .create('h'));
 
         options.addOption(OptionBuilder.withLongOpt("property")
-            .withDescription("Unset a system property")
+            .withDescription(messages.getMessage("cli.option.property"))
             .create('p'));
 
         //
@@ -80,7 +83,8 @@
         }
 
         if (usage || line.hasOption('h')) {
-            io.out.println(getName() + " -- unset a variable or property");
+            io.out.print(" -- ");
+            io.out.println(messages.getMessage("cli.usage.description"));
             io.out.println();
 
             HelpFormatter formatter = new HelpFormatter();
@@ -139,7 +143,7 @@
         log.info("Unsetting variable: " + name);
 
         ensureIsIdentifier(name);
-        
+
         // Command vars always has a parent, set only makes sence when setting in parent's
scope
         Variables vars = this.getVariables().parent();
 

Added: geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/ExitCommandMessages.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/ExitCommandMessages.properties?rev=411705&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/ExitCommandMessages.properties
(added)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/ExitCommandMessages.properties
Mon Jun  5 01:02:55 2006
@@ -0,0 +1,17 @@
+##
+## $Id$
+##
+
+##
+## Option descriptions
+##
+
+cli.option.help=Display this help message
+
+##
+## Option usage (help)
+##
+
+cli.usage.description=Exit the current shell
+
+cli.usage.footer=
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/ExitCommandMessages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/ExitCommandMessages.properties
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/ExitCommandMessages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/HelpCommandMessages.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/HelpCommandMessages.properties?rev=411705&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/HelpCommandMessages.properties
(added)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/HelpCommandMessages.properties
Mon Jun  5 01:02:55 2006
@@ -0,0 +1,17 @@
+##
+## $Id$
+##
+
+##
+## Option descriptions
+##
+
+cli.option.help=Display this help message
+
+##
+## Option usage (help)
+##
+
+cli.usage.description=Display help
+
+cli.usage.footer=For a list of topics try: help topics
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/HelpCommandMessages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/HelpCommandMessages.properties
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/HelpCommandMessages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/UnsetCommandMessages.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/UnsetCommandMessages.properties?rev=411705&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/UnsetCommandMessages.properties
(added)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/UnsetCommandMessages.properties
Mon Jun  5 01:02:55 2006
@@ -0,0 +1,19 @@
+##
+## $Id$
+##
+
+##
+## Option descriptions
+##
+
+cli.option.help=Display this help message
+
+cli.option.property=Unset a system property
+
+##
+## Option usage (help)
+##
+
+cli.usage.description=unset a variable or property
+
+cli.usage.footer=
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/UnsetCommandMessages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/UnsetCommandMessages.properties
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-core/src/main/resources/org/apache/geronimo/gshell/builtins/UnsetCommandMessages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message