-my $spy = $class->new($dbname, "admin", "fruitbat");
-$spy->targets(@targets) if @targets;
+my $spy = $class->new($dbname, "admin", "fruitbat", $opts{n});
+if (@targets) {
+ $spy->targets(@targets);
+} elsif ($opts{f}) {
+ $spy->find_targets($opts{f});
+} elsif (!$opts{a}) {
+ print STDERR "$0: specify -a, -f <query> or list of targets\n";
+ exit 1;
+}
+