continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r574369 - /maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java
Date Mon, 10 Sep 2007 20:51:57 GMT
Author: olamy
Date: Mon Sep 10 13:51:57 2007
New Revision: 574369

URL: http://svn.apache.org/viewvc?rev=574369&view=rev
Log:
add help command to display usage

Modified:
    maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java

Modified: maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java?rev=574369&r1=574368&r2=574369&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java
(original)
+++ maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java
Mon Sep 10 13:51:57 2007
@@ -44,6 +44,7 @@
 import org.codehaus.plexus.PlexusContainerException;
 import org.codehaus.plexus.classworlds.realm.ClassRealm;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
+import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 import java.io.File;
@@ -69,6 +70,8 @@
     {
         Commands command = new Commands();
 
+        
+        
         DatabaseFormat databaseFormat;
         OperationMode mode;
         SupportedDatabase databaseType;
@@ -76,7 +79,16 @@
         try
         {
             Args.parse( command, args );
-
+            if ( command.help )
+            {
+                Args.usage( command );
+                System.exit( 0 );
+            }
+            if (command.version)
+            {
+                System.out.print("continuum-data-management version " + getVersion() );
+                System.exit( 0 );
+            }
             databaseFormat = DatabaseFormat.valueOf( command.databaseFormat );
             mode = OperationMode.valueOf( command.mode );
             databaseType = SupportedDatabase.valueOf( command.databaseType );
@@ -323,6 +335,13 @@
 
     private static class Commands
     {
+        
+        @Argument(description = "Display help information", value = "help", alias = "h")
+        private boolean help;        
+        
+        @Argument(description = "Display version information", value = "version", alias =
"v")
+        private boolean version;        
+        
         @Argument(
             description = "The JDBC URL for the Continuum database that contains the data
to convert, or to import the data into",
             value = "buildsJdbcUrl")



Mime
View raw message