@Override
	public List<Option> choose(List<Option> optionChoices, AddressFactory addressFactory) {
		if (loaderArgs != null) {
			for (Pair<String, String> pair : loaderArgs) {
				String arg = pair.first, val = pair.second;
				boolean foundIt = false;
				for (Option option : optionChoices) {
					if (option.getArg() != null && arg.equalsIgnoreCase(option.getArg())) {
						Object oldVal = option.getValue();
						if (option.parseAndSetValueByType(val, addressFactory)) {
							Msg.info(AutoImporter.class, String.format(
								"Successfully applied \"%s\" to \"%s\" (old: \"%s\", new: \"%s\")",
									arg, option.getName(), oldVal, val));
						}
						else {
							Msg.error(AutoImporter.class, String.format(
								"Failed to apply \"%s\" to \"%s\" (old: \"%s\", bad: \"%s\")", arg,
								option.getName(), oldVal, val));
							return null;
						}
						foundIt = true;
						break;
					}
				}
				if (!foundIt) {
					Msg.error(AutoImporter.class, "Loader does not support " + arg + " argument");
					return null;
				}
			}
		}
		return optionChoices;
	}
An option chooser that applies loader options that were passed in as command line arguments.
Ghidra/Features/Base/src/main/java/ghidra/app/util/importer/LoaderArgsOptionChooser.java