geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r568438 - in /geronimo/server/trunk/modules/geronimo-commands/src/main: groovy/org/apache/geronimo/commands/StartServerCommand.groovy resources/org/apache/geronimo/commands/StartServerCommandMessages.properties
Date Wed, 22 Aug 2007 06:33:23 GMT
Author: jdillon
Date: Tue Aug 21 23:33:23 2007
New Revision: 568438

URL: http://svn.apache.org/viewvc?rev=568438&view=rev
Log:
Add a helper -G --gproperty flag to set a org.apache.geronimo property, so -Gfoo=bar is really
the same as -Dorg.apache.geronimo.foo=bar

Modified:
    geronimo/server/trunk/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy
    geronimo/server/trunk/modules/geronimo-commands/src/main/resources/org/apache/geronimo/commands/StartServerCommandMessages.properties

Modified: geronimo/server/trunk/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy?rev=568438&r1=568437&r2=568438&view=diff
==============================================================================
--- geronimo/server/trunk/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy
(original)
+++ geronimo/server/trunk/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy
Tue Aug 21 23:33:23 2007
@@ -116,6 +116,12 @@
             .withArgName('name=value')
             .create('D'))
         
+        options.addOption(OptionBuilder.withLongOpt('gproperty')
+            .withDescription(messages.getMessage('cli.option.gproperty'))
+            .hasArg()
+            .withArgName('name=value')
+            .create('G'))
+
         options.addOption(OptionBuilder.withLongOpt('javaopt')
             .withDescription(messages.getMessage('cli.option.javaopt'))
             .hasArg()
@@ -212,6 +218,31 @@
                 name = name.trim()
                 
                 properties[name] = value
+            }
+            
+            values.each {
+                addProperty(it)
+            }
+        }
+        
+        if (line.hasOption('G')) {
+            def values = line.getOptionValues('G')
+            
+            def addProperty = { namevalue ->
+                def name, value
+                int i = namevalue.indexOf('=')
+                
+                if (i == -1) {
+                    name = namevalue
+                    value = true
+                }
+                else {
+                    name = namevalue.substring(0, i)
+                    value = namevalue.substring(i + 1, namevalue.size())
+                }
+                name = name.trim()
+                
+                properties["org.apache.geronimo.$name"] = value
             }
             
             values.each {

Modified: geronimo/server/trunk/modules/geronimo-commands/src/main/resources/org/apache/geronimo/commands/StartServerCommandMessages.properties
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-commands/src/main/resources/org/apache/geronimo/commands/StartServerCommandMessages.properties?rev=568438&r1=568437&r2=568438&view=diff
==============================================================================
--- geronimo/server/trunk/modules/geronimo-commands/src/main/resources/org/apache/geronimo/commands/StartServerCommandMessages.properties
(original)
+++ geronimo/server/trunk/modules/geronimo-commands/src/main/resources/org/apache/geronimo/commands/StartServerCommandMessages.properties
Tue Aug 21 23:33:23 2007
@@ -39,6 +39,8 @@
 
 cli.option.property=Set a system property
 
+cli.option.gproperty=Set an org.apache.geronimo property
+
 cli.option.javaopt=Set a JVM flag
 
 cli.option.home=Use a specific Geronimo home directory



Mime
View raw message