public void execute() throws BuildException { Commandline commandLine = new Commandline(); Project aProj = getProject(); int result = 0; // build the command line from what we got the format is // perl foo.pl [options...] commandLine.setExecutable(getFooCommand()); commandLine.createArgument().setValue(COMMAND_FOO); commandLine.createArgument().setValue("-h"); // Check the command line options checkOptions(commandLine); // For debugging System.out.println(commandLine.toString()); result = run(commandLine); if ( result != 0 ) { String msg = "Failed executing: " + commandLine.toString(); throw new BuildException(msg, location); } }