public String getRequiredValue(String valueDescription) throws OptionsException {
        if (lastOptionValue != null) {
            String result = lastOptionValue;
            lastOptionValue = null;
            return result;
        }
        if (index >= params.length) {
            // No more parameters left
            throw new OptionsException(
                    valueDescription + " missing after " + lastOptionOriginalForm);
        }
        String param = params[index];
        if ("--".equals(param)) {
            // End of options marker
            throw new OptionsException(
                    valueDescription + " missing after " + lastOptionOriginalForm);
        }
        index++;
        return param;
    }
Returns the value of the current option, throwing an exception if the value is missing.
cli/src/main/java/com/mcxiaoke/packer/cli/Options.java