Class: Shef::Options

Inherits:
Object show all
Includes:
Mixlib::CLI
Defined in:
lib/chef/shef.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.setup!Object



196
197
198
# File 'lib/chef/shef.rb', line 196

def self.setup!
  self.new.parse_opts
end

Instance Method Details

#parse_optsObject



200
201
202
203
204
205
206
207
# File 'lib/chef/shef.rb', line 200

def parse_opts
  parse_options
  config[:config_file] = config_file_for_shef_mode
  config_msg = config[:config_file] || "none (standalone shef session)"
  puts "loading configuration: #{config_msg}"
  Chef::Config.from_file(config[:config_file]) if !config[:config_file].nil? && File.exists?(config[:config_file]) && File.readable?(config[:config_file])
  Chef::Config.merge!(config)
end