# File lib/rudy/cli/config.rb, line 33
33:       def config
34:         
35:         # TODO: Re-enable:
36:         #     # Display the value for a specific machine.
37:         #     $ rudy -e prod -r db config param-name
38:         
39:         if @@config.nil? || @@config.empty?
40:           return if @@global.quiet
41:           raise Rudy::NoConfig
42:         end
43: 
44:         outform = @@global.format == :json ? :to_json : :to_yaml
45:         
46:         types = @option.marshal_dump.keys & @@config.keys # Intersections only
47:         types = @@config.keys if @option.all
48:         types = [:machines] if types.empty?
49:           
50:         if @option.project
51:           rf = File.join(RUDY_HOME, 'Rudyfile')
52:           raise "Cannot find: #{rf}" unless File.exists?(rf)
53:           li File.read(rf)
54:           
55:         elsif @option.script
56:           conf = fetch_script_config
57:           li conf.to_hash.send(outform) if conf
58:           
59:         else
60:           #li "# ACCOUNTS: [not displayed]" if types.delete(:accounts)
61:           types.each do |conftype|
62:             li "# #{conftype.to_s.upcase}"
63:             next unless @@config[conftype]  # Nothing to output
64:             if conftype == :accounts
65:               skey = @@config[conftype][:aws][:secretkey]
66:               @@config[conftype][:aws][:secretkey] = hide_secret_key(skey)
67:             end
68:             
69:             li @@config[conftype].to_hash.send(outform)
70:           end
71:         end
72:         
73:       end