String key = args[i];
if (key.length() > 0 && key.charAt(0) == '-') { // found a flag
if (key.length() > 1 && key.charAt(1) == '-')
key = key.substring(2); // strip off 2 hyphens
else
<BUG>key = key.substring(1); // strip off the hyphen
if (key.equalsIgnoreCase(PROP) || key.equalsIgnoreCase(PROPS) || key.equalsIgnoreCase(PROPERTIES) || key.equalsIgnoreCase(ARGUMENTS) || key.equalsIgnoreCase(ARGS)) {
result.putAll(propFileToTreeMap(args[i + 1]));
i++;
}</BUG>
}

String key = args[i];
if (key.charAt(0) == '-') { // found a flag
Integer numFlagArgs = flagsToNumArgs.get(key);
int max = numFlagArgs == null ? 1 : numFlagArgs.intValue();
int min = numFlagArgs == null ? 0 : numFlagArgs.intValue();
List<String> flagArgs = new ArrayList<String>();
for (int j = 0; j < max && i + 1 < args.length && (j < min || args[i + 1].length() == 0 || args[i + 1].charAt(0) != '-'); i++, j++) {
flagArgs.add(args[i + 1]);
