public static boolean start(RootDoc root) {

        // Get some options
        String title = "My Ant Tasks";
        String[] templates = null;
        String templatesDir = ".";
        String[] outputdirs = new String[] { "."};

        String[][] options = root.options();
        for (int opt = 0; opt < options.length; opt++) {
            if (options[opt][0].equalsIgnoreCase("-doctitle")) {
                title = options[opt][1];
            } else if (options[opt][0].equalsIgnoreCase("-templates")) {
                templates = options[opt][1].split(","); // comma-separated
                                                        // filenames
            } else if (options[opt][0].equalsIgnoreCase("-templatesdir")) {
                templatesDir = options[opt][1]; // comma-separated filenames
            } else if (options[opt][0].equalsIgnoreCase("-d")) {
                outputdirs = options[opt][1].split(",");
            }
        }

        // Init Velocity-template Generator
        VelocityFacade velocity = null;
        try {
            velocity = new VelocityFacade(new File("."), templatesDir);
        } catch (Exception e) {
            e.printStackTrace();
        }

        // Set global parameters to the templates
        velocity.setAttribute("velocity", velocity);
        velocity.setAttribute("title", title);
        velocity.setAttribute("antroot", new AntRoot(root));

        for (int i = 0; i < templates.length; i++) {
            try {
                if (outputdirs.length > i)
                    velocity.setOutputDir(new File(outputdirs[i]));
                velocity.eval(templates[i], new OutputStreamWriter(System.out));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        return true;
    }