Author: vsiveton
Date: Thu Aug 28 03:21:39 2008
New Revision: 689775

URL: http://svn.apache.org/viewvc?rev=689775&view=rev
Log:
MPH-32: "medium" mode should be the default for help:describe

o added a new minimal parameter and handle it

Modified:
    
maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java

Modified: 
maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java?rev=689775&r1=689774&r2=689775&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java
 (original)
+++ 
maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java
 Thu Aug 28 03:21:39 2008
@@ -188,21 +188,29 @@
     private String mojo;
 
     /**
-     * This flag specifies that full (verbose) information should be given.
+     * This flag specifies that a full (verbose) list of Mojo informations 
should be given.
      *
      * @parameter expression="${full}" default-value="false"
      */
     private boolean full;
 
     /**
-     * This flag specifies that a short list of Mojo information should be 
given.
+     * This flag specifies that a medium list of Mojo informations should be 
given.
      *
-     * @parameter expression="${medium}" default-value="false"
+     * @parameter expression="${medium}" default-value="true"
      * @since 2.0.2
      */
     private boolean medium;
 
     /**
+     * This flag specifies that a minimal list of Mojo informations should be 
given.
+     *
+     * @parameter expression="${minimal}" default-value="false"
+     * @since 2.1
+     */
+    private boolean minimal;
+
+    /**
      * A Maven command like a single goal or a single phase following the 
Maven command line:
      * <br/>
      * <code>mvn [options] [&lt;goal(s)&gt;] [&lt;phase(s)&gt;]</code>
@@ -220,6 +228,8 @@
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {
+        validateParameters();
+
         if ( project == null )
         {
             try
@@ -266,6 +276,17 @@
     // ----------------------------------------------------------------------
 
     /**
+     * Validate parameters
+     */
+    private void validateParameters()
+    {
+        if ( full || minimal )
+        {
+            medium = false;
+        }
+    }
+
+    /**
      * Method to write the Mojo description into the output file
      *
      * @param descriptionBuffer contains the description to be written to the 
file
@@ -482,7 +503,7 @@
         appendAsParagraph( buffer, "Description", toDescription( 
pd.getDescription() ), 0 );
         buffer.append( "\n" );
 
-        if ( full || medium )
+        if ( ( full || medium ) && !minimal )
         {
             append( buffer, "This plugin has " + pd.getMojos().size() + " 
goals:", 0 );
             buffer.append( "\n" );
@@ -503,7 +524,8 @@
                 buffer.append( "\n" );
             }
         }
-        else
+
+        if ( !full )
         {
             buffer.append( "For more information, run 'mvn help:describe [...] 
-Dfull'" );
             buffer.append( "\n" );
@@ -527,7 +549,7 @@
         describeMojoGuts( md, buffer, full );
         buffer.append( "\n" );
 
-        if ( !( full || medium ) )
+        if ( !full )
         {
             buffer.append( "For more information, run 'mvn help:describe [...] 
-Dfull'" );
             buffer.append( "\n" );


Reply via email to