geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r567801 - in /geronimo/sandbox/server-gshell-launcher/modules/geronimo-commands/src/main: groovy/org/apache/geronimo/commands/StartServerCommand.groovy resources/org/apache/geronimo/commands/StartServerCommandMessages.properties
Date Mon, 20 Aug 2007 19:45:07 GMT
Author: jdillon
Date: Mon Aug 20 12:45:04 2007
New Revision: 567801

URL: http://svn.apache.org/viewvc?rev=567801&view=rev
Log:
Add start module support, changed -v to allow -vv for veryverbose

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

Modified: geronimo/sandbox/server-gshell-launcher/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/server-gshell-launcher/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy?rev=567801&r1=567800&r2=567801&view=diff
==============================================================================
--- geronimo/sandbox/server-gshell-launcher/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy
(original)
+++ geronimo/sandbox/server-gshell-launcher/modules/geronimo-commands/src/main/groovy/org/apache/geronimo/commands/StartServerCommand.groovy
Mon Aug 20 12:45:04 2007
@@ -45,29 +45,19 @@
     
     boolean quiet = false
 
-    boolean verbose = false
-
-    boolean veryverbose = false
-
+    int verbose = 0
+    
     int timeout = -1
     
     Map properties = [:]
     
     List javaFlags = []
     
+    List startModules = []
+    
     StartServerCommand() {
         super('start-server')
     }
-
-    /*
-    protected String getUsage() {
-        //
-        // NOTE: super.usage here makes a stack over flow, should probably report to the
groovy folks
-        //
-        
-        return super.getUsage() // TODO:
-    }
-    */
     
     protected Options getOptions() {
         def messages = getMessageSource()
@@ -123,6 +113,12 @@
             .withArgName('jar')
             .create('A'))
         
+        options.addOption(OptionBuilder.withLongOpt('module')
+            .withDescription(messages.getMessage('cli.option.module'))
+            .hasArg()
+            .withArgName('name')
+            .create('m'))
+        
         return options
     }
     
@@ -140,7 +136,11 @@
         }
         
         if (line.hasOption('v')) {
-            verbose = true
+            line.options.each {
+                if (it.opt == 'v') {
+                    verbose++
+                }
+            }
         }
         
         if (line.hasOption('q')) {
@@ -200,6 +200,14 @@
             }
         }
         
+        if (line.hasOption('m')) {
+            def values = line.getOptionValues('m')
+            
+            values.each {
+                startModules << it
+            }
+        }
+        
         return false
     }
     
@@ -282,33 +290,22 @@
                 arg(value: '--long')
             }
             
-            if (verbose) {
+            if (verbose == 1) {
                 arg(value: '--verbose')
             }
-            
-            //
-            // FIXME: Use -vv, and -vvv for logging control
-            //
-            
-            if (veryverbose) {
+            else if (verbose > 1) {
                 arg(value: '--veryverbose')
             }
             
-            /*
-            if (startModules != null) {
-                if (startModules.length == 0) {
-                    fail('At least one module name must be configured with startModule')
-                }
-                
+            if (startModules) {
                 log.info('Overriding the set of modules to be started')
                 
                 arg(value: '--override')
                 
                 startModules.each {
-                    arg(value: "$it")
+                    arg(value: it)
                 }
             }
-            */
         }
         
         return Command.SUCCESS

Modified: geronimo/sandbox/server-gshell-launcher/modules/geronimo-commands/src/main/resources/org/apache/geronimo/commands/StartServerCommandMessages.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/server-gshell-launcher/modules/geronimo-commands/src/main/resources/org/apache/geronimo/commands/StartServerCommandMessages.properties?rev=567801&r1=567800&r2=567801&view=diff
==============================================================================
--- geronimo/sandbox/server-gshell-launcher/modules/geronimo-commands/src/main/resources/org/apache/geronimo/commands/StartServerCommandMessages.properties
(original)
+++ geronimo/sandbox/server-gshell-launcher/modules/geronimo-commands/src/main/resources/org/apache/geronimo/commands/StartServerCommandMessages.properties
Mon Aug 20 12:45:04 2007
@@ -27,7 +27,7 @@
 
 cli.option.help=Display this help message
 
-cli.option.verbose=Enable verbose output
+cli.option.verbose=Enable verbose output; specify multipule times to increase verbosity.
 
 cli.option.quiet=Suppress informative and warning messages
 
@@ -44,6 +44,8 @@
 cli.option.home=Use a specific Geronimo home directory
 
 cli.option.javaagent=Use a specific Java Agent, set to "none" to disable
+
+cli.option.module=Start up a specific module by name.
 
 ##
 ## Option usage (help)



Mime
View raw message