docs: @Nonnull
  	@Override
  	public JmxTransConfiguration parseOptions(@Nonnull String[] args) throws OptionsException, org.apache.commons.cli.ParseException {
  		CommandLineParser parser = new GnuParser();
  		CommandLine cl = parser.parse(getOptions(), args);
  		Option[] options = cl.getOptions();
  
  		JmxTransConfiguration configuration = new JmxTransConfiguration();
  
  		for (Option option : options) {
  			if (option.getOpt().equals("c")) {
  				configuration.setContinueOnJsonError(Boolean.parseBoolean(option.getValue()));
  			} else if (option.getOpt().equals("j")) {
  				File jsonDir = new File(option.getValue());
  				if (jsonDir.exists() && jsonDir.isDirectory()) {
  					configuration.setProcessConfigDir(jsonDir);
  				} else {
  					throw new OptionsException("Path to json directory is invalid: " + jsonDir);
  				}
  			} else if (option.getOpt().equals("f")) {
  				File jsonFile = new File(option.getValue());
  				if (jsonFile.exists() && jsonFile.isFile()) {
  					configuration.setProcessConfigFile(jsonFile);
  				} else {
  					throw new OptionsException("Path to json file is invalid: " + jsonFile);
  				}
  			} else if (option.getOpt().equals("e")) {
  				configuration.setRunEndlessly(true);
  			} else if (option.getOpt().equals("s")) {
  				try {
  					configuration.setRunPeriod(Integer.parseInt(option.getValue()));
  				} catch (NumberFormatException nfe) {
  					throw new OptionsException("Seconds between server job runs must be an integer");
  				}
  			} else if (option.getOpt().equals("a")) {
  				configuration.setAdditionalJars(option.getValuesList());
  			} else if (option.getOpt().equals("h")) {
  				HelpFormatter formatter = new HelpFormatter();
  				formatter.printHelp("java -jar jmxtrans-all.jar", getOptions());
  				configuration.setHelp(true);
  			}
  		}
  		if ((!configuration.isHelp()) && (configuration.getProcessConfigDirOrFile() == null)) {
  			throw new OptionsException("Please specify either the -f or -j option.");
  		}
  		return configuration;
  	}