# File lib/puppet/application/filebucket.rb, line 49
49:   def setup
50:     Puppet::Log.newdestination(:console)
51: 
52:     @client = nil
53:     @server = nil
54: 
55:     trap(:INT) do
56:       $stderr.puts "Cancelling"
57:       exit(1)
58:     end
59: 
60:     if options[:debug]
61:       Puppet::Log.level = :debug
62:     elsif options[:verbose]
63:       Puppet::Log.level = :info
64:     end
65: 
66:     # Now parse the config
67:     Puppet.parse_config
68: 
69:       exit(Puppet.settings.print_configs ? 0 : 1) if Puppet.settings.print_configs?
70: 
71:     require 'puppet/file_bucket/dipper'
72:     begin
73:       if options[:local] or options[:bucket]
74:         path = options[:bucket] || Puppet[:bucketdir]
75:         @client = Puppet::FileBucket::Dipper.new(:Path => path)
76:       else
77:         @client = Puppet::FileBucket::Dipper.new(:Server => Puppet[:server])
78:       end
79:     rescue => detail
80:       $stderr.puts detail
81:       puts detail.backtrace if Puppet[:trace]
82:       exit(1)
83:     end
84:   end