class ToolsArgumentHelper {

    public static void validateCliEnvArgument(ArgumentParser argParser, Option cliOpt, Option enableEnvVariablesOpt) throws ParseException
    {
        String optionName = cliOpt.getLongOpt();
        String envVarName = getEnvVarName(cliOpt);
        //check password cli input, then env vars if enableEnvVariables is true
        boolean blankCliOption = StringUtils.isBlank(argParser.getStringValue(cliOpt));
        boolean enableEnvVars = argParser.getStringValueAsBoolean(enableEnvVariablesOpt, false);
        boolean blankEnvVars = StringUtils.isBlank(ToolsArgumentHelper.getEnvValue(cliOpt));
        if (blankCliOption && !enableEnvVars || blankCliOption && blankEnvVars)
        {
            {
                throw new ParseException(String.format("Either %s or enableEnvVariables with env variable %s is required.", optionName, envVarName));
            }

        }

    }

}