cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1195947 - /cocoon/cocoon3/trunk/cocoon-cli/src/main/java/org/apache/cocoon/cli/CliOptions.java
Date Tue, 01 Nov 2011 12:09:16 GMT
Author: simonetripodi
Date: Tue Nov  1 12:09:16 2011
New Revision: 1195947

URL: http://svn.apache.org/viewvc?rev=1195947&view=rev
Log:
added the pipeline descriptor File option - it works like ant or maven, by default it looks
for `c3p.xml` file

Modified:
    cocoon/cocoon3/trunk/cocoon-cli/src/main/java/org/apache/cocoon/cli/CliOptions.java

Modified: cocoon/cocoon3/trunk/cocoon-cli/src/main/java/org/apache/cocoon/cli/CliOptions.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-cli/src/main/java/org/apache/cocoon/cli/CliOptions.java?rev=1195947&r1=1195946&r2=1195947&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-cli/src/main/java/org/apache/cocoon/cli/CliOptions.java (original)
+++ cocoon/cocoon3/trunk/cocoon-cli/src/main/java/org/apache/cocoon/cli/CliOptions.java Tue
Nov  1 12:09:16 2011
@@ -18,6 +18,9 @@
  */
 package org.apache.cocoon.cli;
 
+import java.io.File;
+
+import com.beust.jcommander.IStringConverter;
 import com.beust.jcommander.Parameter;
 
 public final class CliOptions
@@ -32,6 +35,9 @@ public final class CliOptions
     @Parameter( names = { "-X", "--debug" }, description = "Produce execution debug output."
)
     private boolean debug = false;
 
+    @Parameter( names = { "-f", "--file" }, description = "Force the use of an alternate
c3p file.", converter = FileConverter.class )
+    private File pipelineDescriptor = new File( System.getProperty( "user.dir" ), "c3p.xml"
);
+
     public boolean isPrintHelp()
     {
         return printHelp;
@@ -47,4 +53,20 @@ public final class CliOptions
         return debug;
     }
 
+    public File getPipelineDescriptor()
+    {
+        return pipelineDescriptor;
+    }
+
+    public static class FileConverter
+        implements IStringConverter<File>
+    {
+
+        public File convert( String value )
+        {
+            return new File( value );
+        }
+
+    }
+
 }



Mime
View raw message