# File lib/rhc/commands/env.rb, line 47
    def set(env)
      rest_app = find_app

      with_file = env.index {|item| File.file? item}

      env_vars = []
      env.each {|item| env_vars.concat(collect_env_vars(item))}
      raise RHC::EnvironmentVariableNotProvidedException.new(
        (with_file ?
          "Environment variable(s) not found in the provided file(s).\n" :
          "Environment variable(s) not provided.\n") <<
          "Please provide at least one environment variable using the syntax VARIABLE=VALUE. VARIABLE can only contain letters, digits and underscore ('_') and can't begin with a digit.") if env_vars.empty?

      if with_file
        env_vars.each {|item| default_display_env_var(item.name, item.value)}
        confirm_action "Do you want to set these environment variables on '#{rest_app.name}?"
      end

      say 'Setting environment variable(s) ... '
      rest_app.set_environment_variables(env_vars)
      success 'done'

      0
    end