39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
# File 'lib/chef_fixie/console.rb', line 39
def configure
config_file = nil
if ARGV.first && ARGV[0].chars.first != "-" && config_file = ARGV.shift
config_file = File.expand_path(config_file)
end
ChefFixie.load_config(config_file)
options = {}
OptionParser.new do |opt|
opt.banner = "Usage: fixie [config] [options]"
opt.on('--authz_uri AUTH_URI', "The URI of the opscode authz service") { |v| options[:authz_uri] =v }
opt.on("--sql_database DATABASE", 'The URI of the opscode_chef database') { |v| options[:sql_database] = v }
opt.on_tail('-h', '--help', 'Show this message') do
puts opt
puts "\nExample configuration file:\n\n"
puts ChefFixie::Config.instance.example_config
puts "\n"
exit(1)
end
opt.parse!(ARGV)
end
pp :cli_opts => options if ENV["DEBUG"]
ChefFixie::Config.instance.merge_opts(options)
puts ChefFixie::Config.instance.to_text
end
|