} else if ("transparent-json".equals(ext)) {
userArgs.setTransparentJSON(true);
} else if (ext.startsWith("json-flavor=")) {
userArgs.setJsonFlavor(ext.substring(12));
} else {
throw new XProcException("Unexpected extension: " + ext);
}
continue;
}
if (arg.startsWith("-")) {
throw new XProcException("Unrecognized option: '" + arg + "'.");
}
if (arg.contains("=")) {
KeyValuePair v = parseOption(arg);
userArgs.addOption(v.key, v.value);
arg = null;
argpos++;
} else {
break;
}
}
if (argpos < args.length) {
userArgs.setPipeline(args[argpos++]);
}
while (argpos < args.length) {
if (args[argpos].startsWith("-")) {
throw new XProcException("Only options can occur on the command line after the pipeline document.");
}
KeyValuePair v = parseOption(args[argpos++]);
userArgs.addOption(v.key, v.value);
}