code: public static String getOptionValue(String[] args, String optionName) {
  		String opt = "-" + optionName + "=";
  		for (String arg : args) {
  			if (arg.startsWith(opt))
  				return arg.substring(opt.length());
  		}
  		return null;
  	}
docs: Search for an argument "-&lt;option&gt;=&lt;value&gt;" where option is the given option name, and return the value.