private function mergeEnvironmentVariablesIntoOptions($options)
    {
        // map environment variables to script options
        foreach (self::$optionsMap as $env => $option) {
            if (false !== ($value = getenv($env))) {
                $options[$option] = (string)$value;
            }
        }
        return $options;
    }