use Anime::ANN;
binmode STDOUT, ":utf8";
-GetOptions(\%options, "l=s", "b=s") || exit 1;
+GetOptions(\%options, "l=s", "b=s", "d") || exit 1;
if($options{"l"}) {
@list = Anime::ANN::getlist($options{"l"});
exit 0;
}
+$browse = "";
if($options{"b"}) {
- $id = Anime::ANN::getid $options{"b"};
+ $browse = $options{"b"};
+} elsif($options{"d"}) {
+ $browse = `basename "\$(pwd)"`;
+}
+if($browse) {
+ $id = Anime::ANN::getid $browse;
if(defined($id)) {
exec "htmlview", Anime::ANN::geturl($id);
} else {
- printf STDERR "could not find " . $options{"b"} . "\n";
+ printf STDERR "could not find " . $browse . "\n";
exit 1;
}
}