Author: jdcasey
Date: Wed Jun 25 14:05:19 2008
New Revision: 671657

URL: http://svn.apache.org/viewvc?rev=671657&view=rev
Log:
[MNG-3368] Add an option to display the maven version without stopping the 
build. The new option is -V|--show-version.

Modified:
    
maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java

Modified: 
maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java
URL: 
http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java?rev=671657&r1=671656&r2=671657&view=diff
==============================================================================
--- 
maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java
 (original)
+++ 
maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java
 Wed Jun 25 14:05:19 2008
@@ -160,7 +160,7 @@
 
             return 0;
         }
-        else if ( debug )
+        else if ( debug || commandLine.hasOption( CLIManager.SHOW_VERSION ) )
         {
             showVersion();
         }
@@ -692,6 +692,8 @@
 
         public static final char VERSION = 'v';
 
+        public static final char SHOW_VERSION = 'V';
+
         private Options options;
 
         public static final char NON_RECURSIVE = 'N';
@@ -786,6 +788,10 @@
 
             options.addOption( OptionBuilder.withLongOpt( "fail-never" 
).withDescription(
                 "NEVER fail the build, regardless of project result" ).create( 
FAIL_NEVER ) );
+
+            options.addOption(
+                              OptionBuilder.withLongOpt( "show-version" 
).withDescription( "Display version information WITHOUT stopping build" 
).create(
+                                  SHOW_VERSION ) );
         }
 
         public CommandLine parse( String[] args )


Reply via email to