public static void processArguments(List<String> commandLine, Map<String, String> env,
			File script, Map<String, LaunchParameter<?>> parameters, Map<String, ValStr<?>> args,
			SocketAddress address) {

		commandLine.add(script.getAbsolutePath());
		env.put(ENV_GHIDRA_HOME, Application.getInstallationDirectory().getAbsolutePath());
		if (address != null) {
			env.put(ENV_GHIDRA_TRACE_RMI_ADDR, sockToString(address));
			if (address instanceof InetSocketAddress tcp) {
				env.put(ENV_GHIDRA_TRACE_RMI_HOST, tcp.getAddress().getHostAddress());
				env.put(ENV_GHIDRA_TRACE_RMI_PORT, Integer.toString(tcp.getPort()));
			}
		}

		LaunchParameter<?> param;
		for (int i = 1; (param = parameters.get("arg:" + i)) != null; i++) {
			// Don't use ValStr.str here. I'd like the script's input normalized
			commandLine.add(param.get(args).normStr());
		}

		param = parameters.get("args");
		if (param != null) {
			commandLine.addAll(ShellUtils.parseArgs(param.get(args).str()));
		}

		for (Entry<String, LaunchParameter<?>> ent : parameters.entrySet()) {
			String key = ent.getKey();
			if (key.startsWith(PREFIX_ENV)) {
				String varName = key.substring(PREFIX_ENV.length());
				ValStr<?> val = ent.getValue().get(args);
				env.put(varName, ValStr.normStr(val));
			}
		}
	}
Convert an arguments map into a command line and environment variables

@param commandLine a mutable list to add command line parameters into
@param env a mutable map to place environment variables into. This should likely be
           initialized to {@link System#getenv()} so that Ghidra's environment is inherited
           by the script's process.
@param script the script file
@param parameters the descriptions of the parameters
@param args the arguments to process
@param address the address of the listening TraceRmi socket
Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/launcher/ScriptAttributesParser.java