jvanzyl     2002/07/05 16:46:28

  Modified:    src/java/org/apache/maven/app Maven.java
  Log:
  o Applying stephane's patch
  
  Revision  Changes    Path
  1.48      +50 -6     jakarta-turbine-maven/src/java/org/apache/maven/app/Maven.java
  
  Index: Maven.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/app/Maven.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- Maven.java        5 Jul 2002 22:52:05 -0000       1.47
  +++ Maven.java        5 Jul 2002 23:46:27 -0000       1.48
  @@ -673,10 +673,34 @@
           boolean hadDesc = false;
           boolean hasBlanks = false;
   
  +
  +        // sort by plugin
  +        String lastPluginName = "";
  +
           while (goalIter.hasNext())
           {
               eachGoal = (Goal) goalIter.next();
               description = eachGoal.getDescription();
  +            String goalName = eachGoal.getName();
  +
  +            String pluginName = "";
  +            boolean isMain = false;
  +            boolean newPackage = false;
  +
  +            StringTokenizer st = new StringTokenizer(goalName, ":");
  +            pluginName = st.nextToken();
  +
  +            if(pluginName.equals(goalName))
  +            {
  +                isMain = true;
  +                newPackage = true;
  +            }
  +
  +            if (!pluginName.equals(lastPluginName))
  +            {
  +                newPackage = true;
  +                lastPluginName = pluginName;
  +            }
   
               if (description == null)
               {
  @@ -686,12 +710,32 @@
   
               hadDesc = true;
   
  -            System.out.println("    "
  -                               + format(eachGoal.getName()
  -                                        + " ",
  -                                        30,
  -                                        '.')
  -                                + " " + eachGoal.getDescription());
  +            if(isMain && newPackage)
  +            {
  +                System.out.println("");
  +                System.out.println("[" + pluginName + "] : " + description);
  +            }
  +            else if(newPackage)
  +            {
  +                System.out.println("");
  +                System.out.println("[" + pluginName + "]");
  +                String shortName = goalName.substring(pluginName.length() + 1,
  +                                                      goalName.length());
  +                System.out.println("    " + format(shortName + " ", 30, '.')
  +                                   + " " + description);
  +            }
  +            else if(isMain)
  +            {
  +                System.out.println("o   " + format(goalName + " ", 30, '.')
  +                                   + " " + description);
  +            }   
  +            else
  +            {
  +                String shortName = goalName.substring(pluginName.length() + 1,
  +                                                      goalName.length());
  +                System.out.println("    " + format(shortName + " ", 30, '.')
  +                                   + " " + description);
  +            }
           }
   
           if (hasBlanks)
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to