String[] filenames = cli.getArgs();
if (filenames.length == 0)
help();
log.info("Start: " + PROG_TITLE + " {}", getVersion());
String driverName = cli.getOptionValue("driver");
DriverOptions driverOptions = new DriverOptions(cli);
if (driverName == null) {
if (driverOptions.has(DriverOption.FIREFOX))
driverName = WebDriverManager.FIREFOX;
else if (driverOptions.has(DriverOption.CHROMEDRIVER))
driverName = WebDriverManager.CHROME;
else if (driverOptions.has(DriverOption.IEDRIVER))
driverName = WebDriverManager.IE;
else if (driverOptions.has(DriverOption.PHANTOMJS))
driverName = WebDriverManager.PHANTOMJS;
}
WebDriverManager manager = WebDriverManager.getInstance();
manager.setWebDriverFactory(driverName);
manager.setDriverOptions(driverOptions);