private boolean checkArgument(Arg arg, String[] args, int argi)
			throws InvalidInputException {
		if (!arg.matches(args[argi])) {
			return false;
		}
		if (arg.requiresSubArgs && argi + 1 == args.length) {
			throw new InvalidInputException(args[argi] + " requires an argument");
		}
		return true;
	}
Prints out the usage details and exits the Java application with an exit code that
indicates error.

@param execCmd the command used to run the headless analyzer from the calling method.
Ghidra/Features/Base/src/main/java/ghidra/app/util/headless/AnalyzeHeadless.java