Example usage for org.apache.commons.cli PosixParser PosixParser

List of usage examples for org.apache.commons.cli PosixParser PosixParser

Introduction

In this page you can find the example usage for org.apache.commons.cli PosixParser PosixParser.

Prototype

PosixParser

Source Link

Usage

From source file:com.linkedin.bowser.tool.REPLCommandLine.java

public static void main(String... args) throws Exception {
    Logger root = Logger.getRootLogger();

    Options options = new Options();
    options.addOption("v", "verbose", false, "verbose output");
    options.addOption("t", "threads", true, "parallel threads");
    CommandLineParser parser = new PosixParser();
    CommandLine cmdline = parser.parse(options, args);

    if (cmdline.hasOption("v"))
        root.setLevel(Level.DEBUG);
    else//from w w w . j  a  v a2  s  . c om
        root.setLevel(Level.INFO);

    REPLCommandLine cmd = new REPLCommandLine(cmdline.hasOption("v"),
            cmdline.hasOption("t") ? Integer.parseInt(cmdline.getOptionValue("t")) : null);
    cmd.doRun();
}

From source file:com.genentech.chemistry.openEye.apps.SDFSubRMSD.java

public static void main(String... args) throws IOException { // create command line Options object
    Options options = new Options();
    Option opt = new Option("in", true, "input file oe-supported");
    opt.setRequired(true);/*from  w  ww .  ja v  a 2 s  . c o m*/
    options.addOption(opt);

    opt = new Option("out", true, "output file oe-supported");
    opt.setRequired(false);
    options.addOption(opt);

    opt = new Option("fragFile", true, "file with single 3d substructure query");
    opt.setRequired(false);
    options.addOption(opt);

    opt = new Option("isMDL", false,
            "if given the fragFile is suposed to be an mdl query file, query features are supported.");
    opt.setRequired(false);
    options.addOption(opt);

    CommandLineParser parser = new PosixParser();
    CommandLine cmd = null;
    try {
        cmd = parser.parse(options, args);
    } catch (Exception e) {
        System.err.println(e.getMessage());
        exitWithHelp(options);
    }
    args = cmd.getArgs();

    if (cmd.hasOption("d")) {
        System.err.println("Start debugger and press return:");
        new BufferedReader(new InputStreamReader(System.in)).readLine();
    }

    String inFile = cmd.getOptionValue("in");
    String outFile = cmd.getOptionValue("out");
    String fragFile = cmd.getOptionValue("fragFile");

    // read fragment
    OESubSearch ss;
    oemolistream ifs = new oemolistream(fragFile);
    OEMolBase mol;
    if (!cmd.hasOption("isMDL")) {
        mol = new OEGraphMol();
        oechem.OEReadMolecule(ifs, mol);
        ss = new OESubSearch(mol, OEExprOpts.AtomicNumber, OEExprOpts.BondOrder);
    } else {
        int aromodel = OEIFlavor.Generic.OEAroModelOpenEye;
        int qflavor = ifs.GetFlavor(ifs.GetFormat());
        ifs.SetFlavor(ifs.GetFormat(), (qflavor | aromodel));
        int opts = OEMDLQueryOpts.Default | OEMDLQueryOpts.SuppressExplicitH;
        OEQMol qmol = new OEQMol();
        oechem.OEReadMDLQueryFile(ifs, qmol, opts);
        ss = new OESubSearch(qmol);
        mol = qmol;
    }

    double nSSatoms = mol.NumAtoms();
    double sssCoords[] = new double[mol.GetMaxAtomIdx() * 3];
    mol.GetCoords(sssCoords);
    mol.Clear();
    ifs.close();

    if (!ss.IsValid())
        throw new Error("Invalid query " + args[0]);

    ifs = new oemolistream(inFile);
    oemolostream ofs = new oemolostream(outFile);
    int count = 0;

    while (oechem.OEReadMolecule(ifs, mol)) {
        count++;
        double rmsd = Double.MAX_VALUE;
        double molCoords[] = new double[mol.GetMaxAtomIdx() * 3];
        mol.GetCoords(molCoords);

        for (OEMatchBase mb : ss.Match(mol, false)) {
            double r = 0;
            for (OEMatchPairAtom mp : mb.GetAtoms()) {
                OEAtomBase asss = mp.getPattern();
                double sx = sssCoords[asss.GetIdx() * 3];
                double sy = sssCoords[asss.GetIdx() * 3];
                double sz = sssCoords[asss.GetIdx() * 3];

                OEAtomBase amol = mp.getTarget();
                double mx = molCoords[amol.GetIdx() * 3];
                double my = molCoords[amol.GetIdx() * 3];
                double mz = molCoords[amol.GetIdx() * 3];

                r += Math.sqrt((sx - mx) * (sx - mx) + (sy - my) * (sy - my) + (sz - mz) * (sz - mz));
            }
            r /= nSSatoms;
            rmsd = Math.min(rmsd, r);
        }

        if (rmsd != Double.MAX_VALUE)
            oechem.OESetSDData(mol, "SSSrmsd", String.format("%.3f", rmsd));

        oechem.OEWriteMolecule(ofs, mol);
        mol.Clear();
    }

    ifs.close();
    ofs.close();

    mol.delete();
    ss.delete();
}

From source file:com.aestel.chemistry.openEye.fp.DistMatrix.java

public static void main(String... args) throws IOException {
    long start = System.currentTimeMillis();

    // create command line Options object
    Options options = new Options();
    Option opt = new Option("i", true, "input file [.tsv from FingerPrinter]");
    opt.setRequired(true);/*from   w  ww.  j a  v a  2s  .c  o m*/
    options.addOption(opt);

    opt = new Option("o", true, "outpur file [.tsv ");
    opt.setRequired(true);
    options.addOption(opt);

    CommandLineParser parser = new PosixParser();
    CommandLine cmd = null;
    try {
        cmd = parser.parse(options, args);
    } catch (Exception e) {
        System.err.println(e.getMessage());
        exitWithHelp(options);
    }
    args = cmd.getArgs();

    if (args.length != 0)
        exitWithHelp(options);

    String file = cmd.getOptionValue("i");
    BufferedReader in = new BufferedReader(new FileReader(file));

    file = cmd.getOptionValue("o");
    PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(file)));

    ArrayList<Fingerprint> fps = new ArrayList<Fingerprint>();
    ArrayList<String> ids = new ArrayList<String>();
    String line;
    while ((line = in.readLine()) != null) {
        String[] parts = line.split("\t");
        if (parts.length == 3) {
            ids.add(parts[0]);
            fps.add(new ByteFingerprint(parts[2]));
        }
    }
    in.close();

    out.print("ID");
    for (int i = 0; i < ids.size(); i++) {
        out.print('\t');
        out.print(ids.get(i));
    }
    out.println();

    for (int i = 0; i < ids.size(); i++) {
        out.print(ids.get(i));
        Fingerprint fp1 = fps.get(i);

        for (int j = 0; j <= i; j++) {
            out.printf("\t%.4g", fp1.tanimoto(fps.get(j)));
        }
        out.println();
    }
    out.close();

    System.err.printf("Done %d fingerprints in %.2gsec\n", fps.size(),
            (System.currentTimeMillis() - start) / 1000D);
}

From source file:de.thomasvolk.genexample.GenAlg.java

public static void main(String[] args) throws IOException, ParseException {
    System.out.println("Genetische Algorithmen");

    Options options = new Options();
    options.addOption(option("s", "Jede s Generation wird im Bericht ausgegeben"));
    options.addOption(option("w", "Quelldatei Wagon"));
    options.addOption(option("l", "Quelldatei Passagierliste"));
    options.addOption(option("d", "Zielverzeichnis Bericht"));
    options.addOption(option("a", "Algorithmus Typ " + Arrays.asList(AlgorithmusTyp.values()).toString()));
    options.addOption(option("g", "Anzahl der Generationen"));
    options.addOption(option("p", "Anzahl der Populationen"));
    options.addOption("h", false, "Hilfe");
    CommandLineParser parser = new PosixParser();
    try {/*from   w w  w . j a v  a  2  s.c om*/
        CommandLine cmd = parser.parse(options, args);
        if (cmd.hasOption('h')) {
            printUsage(options);
            System.exit(0);
        }

        int generationen = getNummer(options, cmd.getOptionValue('g'), 2000);
        int populationen = getNummer(options, cmd.getOptionValue('p'), 20);
        int schritte = getNummer(options, cmd.getOptionValue('s'), 100);
        AlgorithmusTyp[] alg = AlgorithmusTyp.values();
        if (cmd.hasOption('a')) {
            try {
                alg = new AlgorithmusTyp[] { AlgorithmusTyp.valueOf(cmd.getOptionValue('a')) };
            } catch (IllegalArgumentException e) {
                printErrorAndExit(e, options);
            }
        }
        String reportDir = cmd.getOptionValue('d');
        reportDir = StringUtils.isBlank(reportDir) ? "report" : reportDir;
        String wagonDatei = cmd.getOptionValue('w');
        String passagierDatei = cmd.getOptionValue('l');
        if (wagonDatei == null) {
            wagonDatei = erzeugeBeispielDatei("wagon.txt");
        }
        if (passagierDatei == null) {
            passagierDatei = erzeugeBeispielDatei("passagiere.csv");
        }
        System.out.println("Wagon Datein: " + wagonDatei);
        System.out.println("Passagier Datei: " + passagierDatei);
        System.out.println("Bericht: " + new File(reportDir).getAbsolutePath());
        System.out.println("Anzahl Generationen: " + generationen);
        System.out.println("Anzahl Populationen: " + populationen);
        System.out.printf("Protokolliere jede %dte Generation im Bericht\n", schritte);

        WagonFactory wagonFactory = new WagonFactory();
        PassagierFactory passagierFactory = new CSVPassagierFactory();

        GenAlg genAlg = new GenAlg(wagonFactory, passagierFactory);
        genAlg.run(alg, passagierDatei, wagonDatei, reportDir, schritte, generationen, populationen);
    } catch (ParseException e) {
        printErrorAndExit(e, options);
    }
}

From source file:net.skyebook.zerocollada.ZeroCollada.java

/**
 * @param args/*  ww  w.  j  a v a2  s .co m*/
 * @throws ParseException 
 * @throws IOException 
 * @throws JDOMException 
 */
public static void main(String[] args) throws ParseException, JDOMException, IOException {
    // Setup Apache Commons CLI
    optionsSetup();

    CommandLineParser parser = new PosixParser();
    CommandLine cmd = parser.parse(options, args);

    if (args.length == 0 || cmd.hasOption(ZCOpts.help)) {
        showHelp();
    }

    // was there a valid operation specified?
    if (hasValidOption(cmd)) {
        File fileFromCommandLine = new File(args[args.length - 1]);
        if (!fileFromCommandLine.exists()) {
            System.err.println(
                    "The file located at " + fileFromCommandLine.toString() + " does not exist!  Qutting.");
            return;
        } else if (fileFromCommandLine.isFile() && fileFromCommandLine.toString().endsWith(".dae")) {
            // we've been given a single file.  Act on this single file
            doRequestedAction(fileFromCommandLine, cmd);
        } else if (fileFromCommandLine.isDirectory()) {
            // We've been given a directory of files process the ones that are .dae
            for (File file : fileFromCommandLine.listFiles()) {
                if (file.isFile() && file.toString().endsWith(".dae")) {
                    doRequestedAction(file, cmd);
                } else {
                    System.err.println(file.toString() + " does not seem to be a COLLADA file");
                }
            }
        }
    } else {
        // Then why are we here?
        if (cmd.hasOption(ZCOpts.includeY)) {
            System.err.println(
                    "You have used the " + ZCOpts.includeY + " option but have not asked for a transform (t)");
        } else if (cmd.hasOption(ZCOpts.anchorCenter)) {
            System.err.println(
                    "You have used the " + ZCOpts.includeY + " option but have not asked for a transform (t)");
        }
    }

}

From source file:com.github.megatronking.svg.cli.Main.java

public static void main(String[] args) {
    Options opt = new Options();
    opt.addOption("d", "dir", true, "the target svg directory");
    opt.addOption("f", "file", true, "the target svg file");
    opt.addOption("o", "output", true, "the output vector file or directory");
    opt.addOption("w", "width", true, "the width size of target vector image");
    opt.addOption("h", "height", true, "the height size of target vector image");

    HelpFormatter formatter = new HelpFormatter();
    CommandLineParser parser = new PosixParser();

    CommandLine cl;//from   w  w  w . j  a v  a 2 s.c om
    try {
        cl = parser.parse(opt, args);
    } catch (ParseException e) {
        formatter.printHelp(HELPER_INFO, opt);
        return;
    }

    if (cl == null) {
        formatter.printHelp(HELPER_INFO, opt);
        return;
    }

    int width = 0;
    int height = 0;
    if (cl.hasOption("w")) {
        width = SCU.parseInt(cl.getOptionValue("w"));
    }
    if (cl.hasOption("h")) {
        height = SCU.parseInt(cl.getOptionValue("h"));
    }

    String dir = null;
    String file = null;
    if (cl.hasOption("d")) {
        dir = cl.getOptionValue("d");
    } else if (cl.hasOption("f")) {
        file = cl.getOptionValue("f");
    }

    String output = null;
    if (cl.hasOption("o")) {
        output = cl.getOptionValue("o");
    }

    if (output == null) {
        if (dir != null) {
            output = dir;
        }
        if (file != null) {
            output = FileUtils.noExtensionName(file) + ".xml";
        }
    }

    if (dir == null && file == null) {
        formatter.printHelp(HELPER_INFO, opt);
        throw new RuntimeException("You must input the target svg file or directory");
    }

    if (dir != null) {
        File inputDir = new File(dir);
        if (!inputDir.exists() || !inputDir.isDirectory()) {
            throw new RuntimeException("The path [" + dir + "] is not exist or valid directory");
        }
        File outputDir = new File(output);
        if (outputDir.exists() || outputDir.mkdirs()) {
            svg2vectorForDirectory(inputDir, outputDir, width, height);
        } else {
            throw new RuntimeException("The path [" + outputDir + "] is not a valid directory");
        }
    }

    if (file != null) {
        File inputFile = new File(file);
        if (!inputFile.exists() || !inputFile.isFile()) {
            throw new RuntimeException("The path [" + file + "] is not exist or valid file");
        }
        svg2vectorForFile(inputFile, new File(output), width, height);
    }
}

From source file:isi.pasco2.Main.java

public static void main(String[] args) {
    CommandLineParser parser = new PosixParser();

    Options options = new Options();
    Option undelete = new Option("d", "Undelete activity records");
    options.addOption(undelete);/*  w ww  . j a v a  2  s. co m*/
    Option disableAllocation = new Option("M", "Disable allocation detection");
    options.addOption(disableAllocation);
    Option fieldDelimeter = OptionBuilder.withArgName("field-delimeter").hasArg()
            .withDescription("Field Delimeter (TAB by default)").create("t");
    options.addOption(fieldDelimeter);

    Option timeFormat = OptionBuilder.withArgName("time-format").hasArg()
            .withDescription("xsd or standard (pasco1 compatible)").create("f");
    options.addOption(timeFormat);

    Option fileTypeOption = OptionBuilder.withArgName("file-type").hasArg()
            .withDescription("The type of file: cache or history").create("T");

    options.addOption(fileTypeOption);

    try {
        CommandLine line = parser.parse(options, args);
        boolean undeleteMethod = false;
        String delimeter = null;
        String format = null;
        String fileType = null;
        boolean disableAllocationTest = false;

        if (line.hasOption("d")) {
            undeleteMethod = true;
        }

        if (line.hasOption('t')) {
            delimeter = line.getOptionValue('t');
        }

        if (line.hasOption('M')) {
            disableAllocationTest = true;
        }

        if (line.hasOption('T')) {
            fileType = line.getOptionValue('T');
        }

        if (line.hasOption('f')) {
            format = line.getOptionValue('f');
        }

        if (line.getArgs().length != 1) {
            System.err.println("No file specified.");
            HelpFormatter formatter = new HelpFormatter();
            formatter.printHelp("pasco2", options);
            System.exit(1);
        }
        String fileName = line.getArgs()[0];

        try {
            IndexFile fr = new FastReadIndexFile(fileName, "r");

            CountingCacheHandler handler = null;

            if (fileType == null) {
                handler = new CountingCacheHandler();
            }
            if (fileType == null) {
                handler = new CountingCacheHandler();
            } else if (fileType.equals("cache")) {
                handler = new CountingCacheHandler();
            } else if (fileType.equals("history")) {
                handler = new Pasco2HistoryHandler();
            }

            if (format != null) {
                if (format.equals("pasco")) {
                    DateFormat regularDateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss.SSS");
                    handler.setDateFormat(regularDateFormat);
                    TimeZone tz = TimeZone.getTimeZone("Australia/Brisbane");
                    regularDateFormat.setTimeZone(tz);

                } else if (format.equals("standard")) {
                    DateFormat xsdDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
                    handler.setDateFormat(xsdDateFormat);
                    xsdDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
                } else {
                    System.err.println("Format not supported.");
                    HelpFormatter formatter = new HelpFormatter();
                    formatter.printHelp("pasco2", options);
                    System.exit(1);
                }
            }

            if (delimeter != null) {
                handler.setDelimeter(delimeter);
            }

            IEIndexFileParser logparser = null;
            if (fileType == null) {
                System.err.println("Using cache file parser.");
                logparser = new IECacheFileParser(fileName, fr, handler);
            } else if (fileType.equals("cache")) {
                logparser = new IECacheFileParser(fileName, fr, handler);
            } else if (fileType.equals("history")) {
                logparser = new IEHistoryFileParser(fileName, fr, handler);
            } else {
                System.err.println("Unsupported file type.");
                HelpFormatter formatter = new HelpFormatter();
                formatter.printHelp("pasco2", options);
                System.exit(1);
            }
            if (disableAllocationTest) {
                logparser.setDisableAllocationTest(true);
            }
            logparser.parseFile();

        } catch (Exception ex) {
            System.err.println(ex.getMessage());
            ex.printStackTrace();
        }

    } catch (ParseException exp) {
        System.out.println("Unexpected exception:" + exp.getMessage());
    }
}

From source file:edu.indiana.d2i.sloan.internal.DeleteVMSimulator.java

public static void main(String[] args) {
    DeleteVMSimulator simulator = new DeleteVMSimulator();

    CommandLineParser parser = new PosixParser();

    try {/*from  ww w  .  j  a va 2  s.  co m*/
        CommandLine line = simulator.parseCommandLine(parser, args);
        String wdir = line.getOptionValue(CMD_FLAG_VALUE.get(CMD_FLAG_KEY.WORKING_DIR));

        if (!HypervisorCmdSimulator.resourceExist(wdir)) {
            logger.error(String.format("Cannot find VM working dir: %s", wdir));
            System.exit(ERROR_CODE.get(ERROR_STATE.VM_NOT_EXIST));
        }

        Properties prop = new Properties();
        String filename = HypervisorCmdSimulator.cleanPath(wdir) + HypervisorCmdSimulator.VM_INFO_FILE_NAME;

        prop.load(new FileInputStream(new File(filename)));

        // cannot delete VM when it is not shutdown
        VMState currentState = VMState.valueOf(prop.getProperty(CMD_FLAG_VALUE.get(CMD_FLAG_KEY.VM_STATE)));

        if (!currentState.equals(VMState.SHUTDOWN)) {
            logger.error("Cannot perform delete when VM is not shutdown");
            System.exit(ERROR_CODE.get(ERROR_STATE.VM_NOT_SHUTDOWN));
        }

        // delete working directory
        FileUtils.deleteDirectory(new File(wdir));

        // success
        System.exit(0);

    } catch (ParseException e) {
        logger.error(String.format("Cannot parse input arguments: %s%n, expected:%n%s",
                StringUtils.join(args, " "), simulator.getUsage(100, "", 5, 5, "")));

        System.exit(ERROR_CODE.get(ERROR_STATE.INVALID_INPUT_ARGS));
    } catch (IOException e) {
        logger.error(e.getMessage(), e);
        System.exit(ERROR_CODE.get(ERROR_STATE.IO_ERR));
    }

}

From source file:edu.indiana.d2i.sloan.internal.StopVMSimulator.java

public static void main(String[] args) {
    StopVMSimulator simulator = new StopVMSimulator();

    CommandLineParser parser = new PosixParser();

    try {/*  ww  w.  ja v a  2s  . c o m*/
        CommandLine line = simulator.parseCommandLine(parser, args);
        String wdir = line.getOptionValue(CMD_FLAG_VALUE.get(CMD_FLAG_KEY.WORKING_DIR));

        if (!HypervisorCmdSimulator.resourceExist(wdir)) {
            logger.error(String.format("Cannot find VM working dir: %s", wdir));
            System.exit(ERROR_CODE.get(ERROR_STATE.VM_NOT_EXIST));
        }

        Properties prop = new Properties();
        String filename = HypervisorCmdSimulator.cleanPath(wdir) + HypervisorCmdSimulator.VM_INFO_FILE_NAME;

        prop.load(new FileInputStream(new File(filename)));

        // cannot stop VM when it is not running
        VMState currentState = VMState.valueOf(prop.getProperty(CMD_FLAG_VALUE.get(CMD_FLAG_KEY.VM_STATE)));

        if (!currentState.equals(VMState.RUNNING)) {
            logger.error("Cannot perform stop when VM is not running");
            System.exit(ERROR_CODE.get(ERROR_STATE.VM_NOT_RUNNING));
        }

        // stop VM
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            logger.error(e.getMessage());
        }

        // update VM status file, i.e. set state to shutdown
        prop.put(CMD_FLAG_VALUE.get(CMD_FLAG_KEY.VM_STATE), VMState.SHUTDOWN.toString());

        // save VM state file back
        prop.store(new FileOutputStream(new File(filename)), "");

        // success
        System.exit(0);

    } catch (ParseException e) {
        logger.error(String.format("Cannot parse input arguments: %s%n, expected:%n%s",
                StringUtils.join(args, " "), simulator.getUsage(100, "", 5, 5, "")));

        System.exit(ERROR_CODE.get(ERROR_STATE.INVALID_INPUT_ARGS));
    } catch (IOException e) {
        logger.error(e.getMessage(), e);
        System.exit(ERROR_CODE.get(ERROR_STATE.IO_ERR));
    }

}

From source file:com.leshazlewood.scms.cli.Main.java

public static void main(String[] args) throws Exception {

    CommandLineParser parser = new PosixParser();

    Options options = new Options();
    options.addOption(CONFIG).addOption(DEBUG).addOption(HELP).addOption(VERSION);

    boolean debug = false;
    File sourceDir = toFile(System.getProperty("user.dir"));
    File configFile = null;/*from  w w  w . jav  a 2s  .com*/
    File destDir = null;

    try {
        CommandLine line = parser.parse(options, args);

        if (line.hasOption(VERSION.getOpt())) {
            printVersionAndExit();
        }
        if (line.hasOption(HELP.getOpt())) {
            printHelpAndExit(options, null, debug, 0);
        }
        if (line.hasOption(DEBUG.getOpt())) {
            debug = true;
        }
        if (line.hasOption(CONFIG.getOpt())) {
            String configFilePath = line.getOptionValue(CONFIG.getOpt());
            configFile = toFile(configFilePath);
        }

        String[] remainingArgs = line.getArgs();
        if (remainingArgs == null) {
            printHelpAndExit(options, null, debug, -1);
        }

        assert remainingArgs != null;

        if (remainingArgs.length == 1) {
            String workingDirPath = System.getProperty("user.dir");
            sourceDir = toFile(workingDirPath);
            destDir = toFile(remainingArgs[0]);
        } else if (remainingArgs.length == 2) {
            sourceDir = toFile(remainingArgs[0]);
            destDir = toFile((remainingArgs[1]));
        } else {
            printHelpAndExit(options, null, debug, -1);
        }

        assert sourceDir != null;
        assert destDir != null;

        if (configFile == null) {
            configFile = new File(sourceDir, DEFAULT_CONFIG_FILE_NAME);
        }

        if (configFile.exists()) {
            if (configFile.isDirectory()) {
                throw new IllegalArgumentException(
                        "Expected configuration file " + configFile + " is a directory, not a file.");
            }
        } else {
            String msg = "Configuration file not found.  Create a default " + DEFAULT_CONFIG_FILE_NAME
                    + " file in your source directory or specify the " + CONFIG
                    + " option to provide the file location.";
            throw new IllegalStateException(msg);
        }

        SiteExporter siteExporter = new SiteExporter();
        siteExporter.setSourceDir(sourceDir);
        siteExporter.setDestDir(destDir);
        siteExporter.setConfigFile(configFile);
        siteExporter.init();
        siteExporter.execute();

    } catch (IllegalArgumentException iae) {
        exit(iae, debug);
    } catch (IllegalStateException ise) {
        exit(ise, debug);
    } catch (Exception e) {
        printHelpAndExit(options, e, debug, -1);
    }
}