title: How to pass arguments while build with bazel
body: <p>How to pass arguments while doing bazel build. Actually my program will accepts two arguments .one is directory and the other one is target.csv
  I need to get the files under a directory and write it to csv.</p>
  
  <pre><code>import java.io.File;
  import java.util.ArrayList;
  import java.util.List;
  import java.util.stream.Collector;
  
  import org.apache.flink.api.common.functions.FlatMapFunction;
  import org.apache.flink.api.java.DataSet;
  import org.apache.flink.api.java.ExecutionEnvironment;
  import org.apache.flink.api.java.tuple.Tuple1;
  import org.apache.flink.api.java.utils.ParameterTool;
  
  
  public class ReadFiles {
  
    /**
     * @param args
     */
    public static void main(String[] args) throws Exception {
  
      // set up the execution environment
      try {
        final ParameterTool params = ParameterTool.fromArgs(args);
        final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
  
        env.setParallelism(1); // without this multiple files creating
        env.getConfig().setGlobalJobParameters(params);
  
        List&lt;String&gt; paths = new ArrayList&lt;String&gt;();
        File dir = new File(params.getRequired("input"));
        for (File f : dir.listFiles()) {
          if (f.isFile()) {
            paths.add(f.getName());
          }
        }
        DataSet&lt;String&gt; data = env.fromCollection(paths).rebalance();
        DataSet&lt;Tuple1&lt;String&gt;&gt; output = data.flatMap(new CSVSplitter());
        env.execute();
  
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
  }
  // The operations are defined by specialized classes, here the Splitter class.
  
  
  class CSVSplitter implements FlatMapFunction&lt;String, Tuple1&lt;String&gt;&gt; {
  
    public void flatMap(String value, Collector&lt;Tuple1&lt;String&gt;&gt; out) throws Exception {
      out.collect(new Tuple1&lt;String&gt;(value));
    }
  
  }
  </code></pre>
  
  <p>And the syntax to build bazel which I am trying -</p>
  
  <pre><code>bazel build FlinkEx/com/practice:read_files
  </code></pre>
  
  <p>facing issues after executing this.</p>
  
  <pre><code>Worker process sent response with exit code: 1.
  error: wrong number of type arguments; required 3
  </code></pre>
  
  <p>I need to pass arguments something like bazel build FlinkEx/com/practice:read_files c:/  c:/target.csv</p>