Commit in hps-java/src/main/java/org/lcsim/hps/users/meeg on MAIN
FilterMCBunches.java+8-41.6 -> 1.7
Nr of empty bunches to be inserted is now a required option.

hps-java/src/main/java/org/lcsim/hps/users/meeg
FilterMCBunches.java 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- FilterMCBunches.java	14 Aug 2012 00:58:03 -0000	1.6
+++ FilterMCBunches.java	20 Sep 2012 18:41:35 -0000	1.7
@@ -7,6 +7,7 @@
 import org.apache.commons.cli.CommandLineParser;
 import org.apache.commons.cli.HelpFormatter;
 import org.apache.commons.cli.Option;
+import org.apache.commons.cli.OptionBuilder;
 import org.apache.commons.cli.Options;
 import org.apache.commons.cli.ParseException;
 import org.apache.commons.cli.PosixParser;
@@ -23,7 +24,7 @@
  * Can also be used to chain multiple LCIO files together.
  *
  * @author Sho Uemura <[log in to unmask]>
- * @version $Id: FilterMCBunches.java,v 1.6 2012/08/14 00:58:03 meeg Exp $
+ * @version $Id: FilterMCBunches.java,v 1.7 2012/09/20 18:41:35 phansson Exp $
  */
 public class FilterMCBunches {
 
@@ -34,11 +35,11 @@
      */
     private static Options createCommandLineOptions() {
         Options options = new Options();
-
-        options.addOption(new Option("e", true, "Interval between non-empty events"));
+        Option opt_e = OptionBuilder.hasArg(true).isRequired(true).withDescription("Interval between non-empty events").create("e");
+        options.addOption(opt_e);
+        //options.addOption(new Option("e", true, "Interval between non-empty events"));
         options.addOption(new Option("n", true, "Number of events to read"));
         options.addOption(new Option("a", true, "All events - no cuts"));
-
         return options;
     }
 
@@ -76,6 +77,9 @@
         int nEmpty = 0;
         if (cl.hasOption("e")) {
             nEmpty = Integer.valueOf(cl.getOptionValue("e"));
+        } else {
+            System.out.println("You need to specify the number of empty bunches!");
+            System.exit(1);
         }
 
         int nEvents = -1;
CVSspam 0.2.12


Use REPLY-ALL to reply to list

To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1