bloritsch    02/01/10 09:37:57

  Modified:    src/java/org/apache/cocoon Main.java
  Log:
  fix cocoon.xconf cli option implementation
  
  Revision  Changes    Path
  1.4       +11 -4     xml-cocoon2/src/java/org/apache/cocoon/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/Main.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Main.java 10 Jan 2002 16:01:00 -0000      1.3
  +++ Main.java 10 Jan 2002 17:37:57 -0000      1.4
  @@ -97,7 +97,7 @@
    * Command line entry point.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Stefano Mazzocchi</a>
  - * @version CVS $Revision: 1.3 $ $Date: 2002/01/10 16:01:00 $
  + * @version CVS $Revision: 1.4 $ $Date: 2002/01/10 17:37:57 $
    */
   public class Main {
   
  @@ -221,7 +221,7 @@
   
           String destDir = Constants.DEFAULT_DEST_DIR;
           String contextDir = Constants.DEFAULT_CONTEXT_DIR;
  -        File conf = new File(contextDir, "/cocoon.xconf");
  +        String configFile = null;
           String workDir = Constants.DEFAULT_WORK_DIR;
           List targets = new ArrayList();
           CLArgsParser parser = new CLArgsParser(args, OPTIONS);
  @@ -245,7 +245,7 @@
                       break;
   
                   case Main.CONFIG_FILE:
  -                     conf = new File(contextDir, option.getArgument());
  +                     configFile = option.getArgument();
                        break;
   
                   case Main.HELP_OPT:
  @@ -341,7 +341,14 @@
               }
               File work = getDir(workDir, "working");
               File context = getDir(contextDir, "context");
  -            conf = getConfigurationFile(context);
  +            File conf = null;
  +
  +            if ( null == configFile ) {
  +                conf = getConfigurationFile(context);
  +            } else {
  +                conf = new File(context, configFile);
  +            }
  +
               DefaultContext appContext = new DefaultContext();
               appContext.put(Constants.CONTEXT_CLASS_LOADER, 
Main.class.getClassLoader());
               CommandlineContext clContext = new CommandlineContext(contextDir);
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to