lib/pgsync/client.rb in pgsync-0.5.2 vs lib/pgsync/client.rb in pgsync-0.5.3
- old
+ new
@@ -2,16 +2,19 @@
class Client
include Utils
def initialize(args)
@args = args
- $stderr.sync = true
+ output.sync = true
end
def perform(testing: true)
opts = parse_args
+ # TODO throw error in 0.6.0
+ warn "Specify either --db or --config, not both" if opts[:db] && opts[:config]
+
if opts.version?
log VERSION
elsif opts.help?
log opts
# TODO remove deprecated conditions (last two)
@@ -20,10 +23,10 @@
else
Sync.new.perform(opts)
end
rescue Error, PG::ConnectionBad => e
raise e if testing
- abort colorize(e.message, 31) # red
+ abort colorize(e.message, :red)
end
def self.start
new(ARGV).perform(testing: false)
end