class Mixlib::ShellOut

def parse_options(opts)

def parse_options(opts)
  opts.each do |option, setting|
    case option.to_s
    when 'cwd'
      self.cwd = setting
    when 'domain'
      self.domain = setting
    when 'password'
      self.password = setting
    when 'user'
      self.user = setting
      self.with_logon = setting
    when 'group'
      self.group = setting
    when 'umask'
      self.umask = setting
    when 'timeout'
      self.timeout = setting
    when 'returns'
      self.valid_exit_codes = Array(setting)
    when 'live_stream'
      self.live_stdout = self.live_stderr = setting
    when 'live_stdout'
      self.live_stdout = setting
    when 'live_stderr'
      self.live_stderr = setting
    when 'input'
      self.input = setting
    when 'logger'
      self.logger = setting
    when 'log_level'
      self.log_level = setting
    when 'log_tag'
      self.log_tag = setting
    when 'environment', 'env'
      # Set the LC_ALL from the parent process if the user wanted
      # to use the default.
      if setting && setting.has_key?("LC_ALL") && setting['LC_ALL'].nil?
        setting['LC_ALL'] = ENV['LC_ALL']
      end
      # passing :environment => nil means don't set any new ENV vars
      @environment = setting.nil? ? {} : @environment.dup.merge!(setting)
    else
      raise InvalidCommandOption, "option '#{option.inspect}' is not a valid option for #{self.class.name}"
    end
  end
  validate_options(opts)
end