'apply options passed through environment variables'

def apply_env_options(self):

    env_options = filter(self.is_flower_envvar, os.environ)
    for env_var_name in env_options:
        name = env_var_name.replace(self.ENV_VAR_PREFIX, '', 1).lower()
        value = os.environ[env_var_name]
        try:
            option = options._options[name]
        except:
            option = options._options[name.replace('_', '-')]
        if option.multiple:
            value = [option.type(i) for i in value.split(',')]
        else:
            value = option.type(value)
        setattr(options, name, value)
