--- bin/ApplySnapshot 2003/08/05 09:20:08 1.2 +++ bin/ApplySnapshot 2003/08/05 09:52:36 1.3 @@ -14,14 +14,14 @@ $| = 1; $result = GetOptions("debug!", "verbose!", "help", - "host=s", "user=s", "password=s"); + "host=s", "user=s", "password=s", "snapshot=s"); my $debug = $opt_debug || 0; my $verbose = $opt_verbose || 0; my $snapshot = $opt_snapshot || "__Snapshot"; if (defined($opt_help) || (scalar(@ARGV) < 1)) { - print "Usage: $0 --host=name --user=name --password=string slavedb\n"; + print "Usage: $0 --host=name --user=name --password=string --snapshot=file slavedb\n"; exit ((scalar(@ARGV) < 1)? 1:0); } @@ -34,10 +34,13 @@ my $conn = Pg::connectdb($sinfo); -my $inpf = new IO::File; -$inpf = STDIN; - -$RServ::quiet = !$verbose; +my $inpf; +if (defined($opt_snapshot)) { + $inpf = new IO::File; + $inpf->open("< $opt_snapshot"); +} else { + $inpf = STDIN; +} $res = ApplySnapshot ($conn, $inpf);